How to use the cobbler.utils.to_string_from_fields 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 / cli.py View on Github external
print("No breed named '%s' found" % name)
                    sys.exit(1)
            else:
                print("No breeds found in the signature, a signature update is recommended")
                sys.exit(1)
            return
        else:
            item = remote.get_item(otype, name)
            if item == "~":
                print("No %s found: %s" % (otype, name))
                sys.exit(1)

    if otype == "distro":
        data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
        data = "%-40s: %s" % (item['name'], item['value'])
    print(data)
github cobbler / cobbler / cobbler / cli.py View on Github external
print("\nBreed '%s' has %d total signatures" % (name, total_sigs))
                else:
                    print("No breed named '%s' found" % name)
                    sys.exit(1)
            else:
                print("No breeds found in the signature, a signature update is recommended")
                sys.exit(1)
            return
        else:
            item = remote.get_item(otype, name)
            if item == "~":
                print("No %s found: %s" % (otype, name))
                sys.exit(1)

    if otype == "distro":
        data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
github cobbler / cobbler / cobbler / cli.py View on Github external
print("No %s found: %s" % (otype, name))
                sys.exit(1)

    if otype == "distro":
        data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
        data = "%-40s: %s" % (item['name'], item['value'])
    print(data)
github cobbler / cobbler / cobbler / cli.py View on Github external
return
        else:
            item = remote.get_item(otype, name)
            if item == "~":
                print("No %s found: %s" % (otype, name))
                sys.exit(1)

    if otype == "distro":
        data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
        data = "%-40s: %s" % (item['name'], item['value'])
    print(data)
github cobbler / cobbler / cobbler / cli.py View on Github external
else:
                print("No breeds found in the signature, a signature update is recommended")
                sys.exit(1)
            return
        else:
            item = remote.get_item(otype, name)
            if item == "~":
                print("No %s found: %s" % (otype, name))
                sys.exit(1)

    if otype == "distro":
        data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
        data = "%-40s: %s" % (item['name'], item['value'])
    print(data)
github cobbler / cobbler / cobbler / items / item.py View on Github external
def to_string(self):
        return utils.to_string_from_fields(self, self.get_fields())
github cobbler / cobbler / cobbler / cli.py View on Github external
data = utils.to_string_from_fields(item, distro.FIELDS)
    elif otype == "profile":
        data = utils.to_string_from_fields(item, profile.FIELDS)
    elif otype == "system":
        data = utils.to_string_from_fields(item, system.FIELDS,
                                           system.NETWORK_INTERFACE_FIELDS)
    elif otype == "repo":
        data = utils.to_string_from_fields(item, repo.FIELDS)
    elif otype == "image":
        data = utils.to_string_from_fields(item, image.FIELDS)
    elif otype == "mgmtclass":
        data = utils.to_string_from_fields(item, mgmtclass.FIELDS)
    elif otype == "package":
        data = utils.to_string_from_fields(item, package.FIELDS)
    elif otype == "file":
        data = utils.to_string_from_fields(item, file.FIELDS)
    elif otype == "setting":
        data = "%-40s: %s" % (item['name'], item['value'])
    print(data)