5 from wizard import command, deploy, shell, util
8 options, args = parse_args(argv, baton)
9 # Directory information not transferred via command line, so this
10 # will not error due to the changed directory.
11 shell.drop_priviledges(".", options.log_file)
12 command.chdir_to_production()
13 production = deploy.ProductionCopy(".")
17 os.unlink(production.blacklisted_file)
19 if e.errno == errno.ENOENT:
20 logging.warning("No-op: application was not blacklisted")
24 open(production.blacklisted_file, 'w').write(args[0] + "\n")
26 def parse_args(argv, baton):
27 usage = """usage: %prog blacklist [ARGS] REASON
28 %prog blacklist --delete
30 Adds the file .wizard/blacklisted so that future upgrades
31 are not attempted without manual intervention. If run
32 with the flag --delete, it deletes the blacklist file."""
33 parser = command.WizardOptionParser(usage)
34 parser.add_option("--delete", dest="delete", action="store_true",
35 default=False, help="Delete the blacklist entry, enabling normal usage.")
36 options, args = parser.parse_all(argv)
39 parser.error("too many arguments")
42 parser.error("too many arguments")
44 parser.error("must specify reason")