Esempio n. 1
0
    def save(self, filename):
        """Dump current config into given file

        :param filename: string
        """
        if self.__config is None:
            raise exceptions.DevopsConfigIsNone()
        with open(filename, 'w') as f:
            f.write(yaml.dump(self.__config, default_flow_style=False))
Esempio n. 2
0
    def set_value_by_keypath(self, keypath, value):
        """Function for set value of devops settings by keypath.

        It's forbidden to set value of self.config directly, so
        it's possible simply set value by keypath
        """
        if self.config is None:
            raise exceptions.DevopsConfigIsNone()
        conf = self.__config['template']['devops_settings']
        set_value_for_dict_by_keypath(conf, keypath, value)