def list()

in container-images/gerrit-init/tools/gerrit-initializer/initializer/helpers/git.py [0:0]


    def list(self):
        command = "git config -f %s --list" % (self.path)
        options = self._execute_shell_command_and_get_output_lines(command)
        option_list = list()
        for opt in options:
            parsed_opt = dict()
            full_key, value = opt.split("=", 1)
            parsed_opt["value"] = value
            full_key = full_key.split(".")
            parsed_opt["section"] = full_key[0]
            if len(full_key) == 2:
                parsed_opt["subsection"] = None
                parsed_opt["key"] = full_key[1]
            elif len(full_key) == 3:
                parsed_opt["subsection"] = full_key[1]
                parsed_opt["key"] = full_key[2]
            option_list.append(parsed_opt)

        return option_list