How to use the cobbler.utils.input_boolean function in cobbler

To help you get started, we’ve selected a few cobbler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cobbler / cobbler / cobbler / items / system.py View on Github external
def set_static(self, truthiness, interface):
        intf = self.__get_interface(interface)
        intf["static"] = utils.input_boolean(truthiness)
github cobbler / cobbler / cobbler / items / item_file.py View on Github external
def set_is_dir(self, is_dir):
        """
        If true, treat file resource as a directory. Templates are ignored.
        """
        self.is_dir = utils.input_boolean(is_dir)
github cobbler / cobbler / cobbler / items / system.py View on Github external
def set_repos_enabled(self, repos_enabled):
        self.repos_enabled = utils.input_boolean(repos_enabled)
github cobbler / cobbler / cobbler / items / mgmtclass.py View on Github external
def set_is_definition(self, isdef):
        self.is_definition = utils.input_boolean(isdef)
github cobbler / cobbler / cobbler / items / profile.py View on Github external
def set_enable_menu(self, enable_menu):
        """
        Sets whether or not the profile will be listed in the default
        PXE boot menu.  This is pretty forgiving for YAML's sake.
        """
        self.enable_menu = utils.input_boolean(enable_menu)
github cobbler / cobbler / cobbler / settings.py View on Github external
def __setattr__(self, name, value):
        if name in DEFAULTS:
            try:
                if DEFAULTS[name][1] == "str":
                    value = str(value)
                elif DEFAULTS[name][1] == "int":
                    value = int(value)
                elif DEFAULTS[name][1] == "bool":
                    if utils.input_boolean(value):
                        value = 1
                    else:
                        value = 0
                elif DEFAULTS[name][1] == "float":
                    value = float(value)
                elif DEFAULTS[name][1] == "list":
                    value = utils.input_string_or_list(value)
                elif DEFAULTS[name][1] == "dict":
                    value = utils.input_string_or_dict(value)[1]
            except:
                raise AttributeError

            self.__dict__[name] = value
            if not utils.update_settings_file(self.to_dict()):
                raise AttributeError
github cobbler / cobbler / cobbler / items / repo.py View on Github external
def set_mirror_locally(self, value):
        self.mirror_locally = utils.input_boolean(value)