Exemple #1
0
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()
Exemple #2
0
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()
Exemple #3
0
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()
Exemple #4
0
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()
Exemple #5
0
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()
Exemple #7
0
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)