class PostInstallCmd(Cmd): """PostInstall Setup Cmd.""" name = "post_install" def __init__(self, args: dict): super().__init__(args) self.consul = Consul(args.config) def process(self): self.consul.validate(self.name) self.consul.post_install()
class PrepareCmd(Cmd): """Prepare Setup Cmd.""" name = "prepare" def __init__(self, args: dict): super().__init__(args) self.consul = Consul(args.config) def process(self): self.consul.validate(self.name) self.consul.prepare()
class ResetCmd(Cmd): """Reset Setup Cmd.""" name = "reset" def __init__(self, args): super().__init__(args) self.consul = Consul(args.config) def process(self): self.consul.validate(self.name) self.consul.reset()
class TestCmd(Cmd): """Test Setup Cmd.""" name = "test" def __init__(self, args): super().__init__(args) self.consul = Consul(args.config) def process(self): self.consul.validate(self.name) self.consul.test()
class ConfigCmd(Cmd): """Setup Config Cmd.""" name = "config" def __init__(self, args): super().__init__(args) self.consul = Consul(args.config) def process(self): self.consul.validate(self.name) self.consul.config()
class InitCmd(Cmd): """Init Setup Cmd.""" name = "init" def __init__(self, args): """Init cmd.""" super().__init__(args) self.consul = Consul(args.config) def process(self): """Process cmd.""" self.consul.validate(self.name) self.consul.init()
class CleanupCmd(Cmd): """Cleanup Setup Cmd.""" name = "cleanup" @staticmethod def _add_extended_args(parser): parser.add_argument('--pre-factory', action="store_true", help='Factory cleanup.') def __init__(self, args): super().__init__(args) self.consul = Consul(args.config) self.pre_factory = args.pre_factory def process(self): self.consul.validate(self.name) self.consul.cleanup(self.pre_factory)