def __init__(self, arguments: list): self._parser = Parser(arguments) self._parsed_arguments = self._parser.parsed_arguments config = YamlConfig('~/.directory-tools.yml') host = config.get('host') domain = config.get('domain') top_level = config.get('top_level') manager_name = config.get('manager-name') self._suffix = 'dc=' + domain + ',dc=' + top_level self._server_name = host + '.' + domain + '.' + top_level self._manager_dn = 'cn=' + manager_name + ',' + self._suffix self._manager_password = config.get('manager-password') self._client = None
def __init__(self, arguments: list): self.parser = self.create_parser() self.parsed_arguments = self.parser.parse_args(arguments) print(self.parsed_arguments) config = YamlConfig('~/.virtual-box-tools.yml') config_file_path = config.get('host_file') self.CANONICAL_NAMES_KEY = 'canonical_name' self.CATCH_ALL_DOMAIN_KEY = 'catch_all_domain' if config_file_path != '': config_file_path = expanduser(config_file_path) self.host_file_path = config_file_path else: self.host_file_path = expanduser(self.parsed_arguments.host_file) if isfile(self.host_file_path): self.yaml_tree = self.load_config_file() else: print('File not found: ' + self.host_file_path) exit(1)