Commit d45cd67e authored by katharina.berger's avatar katharina.berger

more adding unpublish

parent 041b5d8e
......@@ -375,7 +375,7 @@ def main(argv):
args, lastargs = getopt.getopt(argv, "p:l:c:o:", ['list-retracted-version', 'config=', 'create-new-mapfiles=',
'project=', 'start-date=', 'stop-date=', 'dry-run',
'send-mail=', 'log=', 'get-list-of-new-mapfiles=', 'output=',
'check-consistency='])
'check-consistency=', 'unpublish-retracted'])
except getopt.error:
print sys.exc_value
print usage
......@@ -394,6 +394,8 @@ def main(argv):
check_mapfiles = False
get_list_of_mapfiles = False
output_folder = '/tmp'
unpublish_retracted = False
for flag, arg in args:
if flag == '--list-retracted-version':
......@@ -423,13 +425,15 @@ def main(argv):
logfile_path = arg
elif flag in ['-o', '--output']:
output_folder = arg
elif flag == 'unpublish-retracted':
unpublish_retracted = True
if not project:
print usage
sys.exit(0)
if list_retracted == create_maps == get_list_of_mapfiles == check_mapfiles:
print "Please use exactly one from ['--list-retracted-version', '--get-list-of-new-mapfiles', '--create-new-mapfiles', '--check-consistency']"
if list_retracted == create_maps == get_list_of_mapfiles == check_mapfiles == unpublish_retracted:
print "Please use exactly one from ['--list-retracted-version', '--get-list-of-new-mapfiles', '--create-new-mapfiles', '--check-consistency', '--unpublish-retracted']"
sys.exit(0)
configfile = os.path.join(config_dir, config_filename)
......@@ -453,6 +457,8 @@ def main(argv):
if list_retracted:
check_replicas(log, config, project, start_datetime=start_datetime, stop_datetime=stop_datetime, dry_run=dry_run, recipients=recipients)
elif unpublish_retracted:
unpublish_retracted(log, config, project, output_folder, start_datetime=start_datetime, stop_datetime=stop_datetime, dry_run=dry_run, recipients=recipients)
elif get_list_of_mapfiles:
project_config = SectionParser(section='project:%s' % project.lower(), directory=config_dir)
output_file = open(os.path.join(output_folder, 'new_replica.lst'), 'w')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment