class PrepareCmd(Cmd):
    """Prepare Setup Cmd."""
    name = "prepare"

    def __init__(self, args: dict):
        super().__init__(args)
        self.openldap = Openldap(args.config)

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.prepare()
        return rc
class PostUpgradeCmd(Cmd):
    """Post Upgrade Setup Cmd."""
    name = "postupgrade"

    def __init__(self, args):
        super().__init__(args)
        self.openldap = Openldap(None)

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.postupgrade()
        return rc
class PostInstallCmd(Cmd):
    """PostInstall Setup Cmd."""
    name = "post_install"

    def __init__(self, args: dict):
        super().__init__(args)
        self.openldap = Openldap(args.config)

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.post_install()
        return rc
class CleanupCmd(Cmd):
    """Cleanup Setup Cmd."""
    name = "cleanup"

    def __init__(self, args):
        super().__init__(args)
        self.openldap = Openldap(args.config)

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.cleanup()
        return rc
class ResetCmd(Cmd):
    """Reset Setup Cmd."""
    name = "reset"

    def __init__(self, args):
        super().__init__(args)
        self.openldap = Openldap(args.config)

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.reset()
        return rc
class TestCmd(Cmd):
    """Test Setup Cmd."""
    name = "test"

    @staticmethod
    def _add_extended_args(parser):
        parser.add_argument('--plan', help='Test Plan', type=str)

    def __init__(self, args):
        super().__init__(args)
        self.openldap = Openldap(args.config)
        self.test_plan = args.plan

    def process(self):
        # TODO: Add actions here
        rc = self.openldap.test(self.test_plan, self._url)
        return rc
 def __init__(self, args: dict):
     super().__init__(args)
     self.openldap = Openldap(args.config)
 def __init__(self, args):
     super().__init__(args)
     self.openldap = Openldap(None)
 def __init__(self, args):
     super().__init__(args)
     self.openldap = Openldap(args.config)
     self.test_plan = args.plan