summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cobbler/action_check.py5
-rw-r--r--cobbler/action_litesync.py8
-rw-r--r--cobbler/action_sync.py23
-rw-r--r--cobbler/item.py12
-rw-r--r--cobbler/item_distro.py9
-rw-r--r--cobbler/item_profile.py10
-rw-r--r--cobbler/item_repo.py5
-rw-r--r--cobbler/item_system.py7
-rw-r--r--cobbler/modules/cli_distro.py5
-rw-r--r--cobbler/modules/cli_profile.py5
-rw-r--r--cobbler/modules/cli_repo.py5
-rw-r--r--cobbler/modules/cli_system.py4
-rw-r--r--cobbler/settings.py6
-rw-r--r--cobbler/utils.py16
-rw-r--r--cobbler/webui/master.py4
-rw-r--r--docs/cobbler.pod4
-rw-r--r--tests/tests.py35
17 files changed, 131 insertions, 32 deletions
diff --git a/cobbler/action_check.py b/cobbler/action_check.py
index a4a09f63..1fb4734f 100644
--- a/cobbler/action_check.py
+++ b/cobbler/action_check.py
@@ -141,8 +141,9 @@ class BootCheck:
"""
Check if cobbler.conf's tftpboot directory exists
"""
- if not os.path.exists(self.settings.tftpboot):
- status.append(_("please create directory: %(dirname)s") % { "dirname" : self.settings.tftpboot })
+ bootloc = utils.tftpboot_location()
+ if not os.path.exists(bootloc):
+ status.append(_("please create directory: %(dirname)s") % { "dirname" : bootloc })
def check_tftpd_conf(self,status):
diff --git a/cobbler/action_litesync.py b/cobbler/action_litesync.py
index 457f3afd..9200a3e7 100644
--- a/cobbler/action_litesync.py
+++ b/cobbler/action_litesync.py
@@ -66,12 +66,13 @@ class BootLiteSync:
self.add_single_profile(k.name)
def remove_single_distro(self, name):
+ bootloc = utils.tftpboot_location()
# delete distro YAML file in distros/$name in webdir
self.sync.rmfile(os.path.join(self.settings.webdir, "distros", name))
# delete contents of images/$name directory in webdir
self.sync.rmtree(os.path.join(self.settings.webdir, "images", name))
# delete contents of images/$name in tftpboot
- self.sync.rmtree(os.path.join(self.settings.tftpboot, "images", name))
+ self.sync.rmtree(os.path.join(bootloc, "images", name))
# delete potential symlink to tree in webdir/links
self.sync.rmfile(os.path.join(self.settings.webdir, "links", name))
@@ -127,6 +128,7 @@ class BootLiteSync:
self.sync.retemplate_yum_repos(system,False)
def remove_single_system(self, name):
+ bootloc = utils.tftpboot_location()
system_record = self.systems.find(name=name)
# rebuild system_list file in webdir
self.sync.write_listings()
@@ -152,7 +154,7 @@ class BootLiteSync:
if distro is not None and distro in [ "ia64", "IA64"]:
itanic = True
if not itanic:
- self.sync.rmfile(os.path.join(self.settings.tftpboot, "pxelinux.cfg", filename))
+ self.sync.rmfile(os.path.join(bootloc, "pxelinux.cfg", filename))
else:
- self.sync.rmfile(os.path.join(self.settings.tftpboot, filename))
+ self.sync.rmfile(os.path.join(bootloc, filename))
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index 25969063..8a0eadfe 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -57,14 +57,15 @@ class BootSync:
self.repos = config.repos()
self.blend_cache = {}
self.load_snippet_cache()
+ self.bootloc = utils.tftpboot_location()
def run(self):
"""
Syncs the current configuration file with the config tree.
Using the Check().run_ functions previously is recommended
"""
- if not os.path.exists(self.settings.tftpboot):
- raise CX(_("cannot find directory: %s") % self.settings.tftpboot)
+ if not os.path.exists(self.bootloc):
+ raise CX(_("cannot find directory: %s") % self.bootloc)
# run pre-triggers...
utils.run_triggers(None, "/var/lib/cobbler/triggers/sync/pre/*")
@@ -104,9 +105,9 @@ class BootSync:
for loader in self.settings.bootloaders.keys():
path = self.settings.bootloaders[loader]
newname = os.path.basename(path)
- destpath = os.path.join(self.settings.tftpboot, newname)
+ destpath = os.path.join(self.bootloc, newname)
self.copyfile(path, destpath)
- self.copyfile("/var/lib/cobbler/menu.c32", os.path.join(self.settings.tftpboot, "menu.c32"))
+ self.copyfile("/var/lib/cobbler/menu.c32", os.path.join(self.bootloc, "menu.c32"))
def write_dhcp_file(self):
"""
@@ -278,8 +279,8 @@ class BootSync:
if x in ["kickstarts","kickstarts_sys","images","systems","distros","profiles","repo_profile","repo_system"]:
# clean out directory contents
self.rmtree_contents(path)
- self.rmtree_contents(os.path.join(self.settings.tftpboot, "pxelinux.cfg"))
- self.rmtree_contents(os.path.join(self.settings.tftpboot, "images"))
+ self.rmtree_contents(os.path.join(self.bootloc, "pxelinux.cfg"))
+ self.rmtree_contents(os.path.join(self.bootloc, "images"))
def copy_distros(self):
"""
@@ -297,7 +298,7 @@ class BootSync:
self.copy_single_distro_files(d)
def copy_single_distro_files(self, d):
- for dirtree in [self.settings.tftpboot, self.settings.webdir]:
+ for dirtree in [self.bootloc, self.settings.webdir]:
distros = os.path.join(dirtree, "images")
distro_dir = os.path.join(distros,d.name)
self.mkdir(distro_dir)
@@ -763,7 +764,7 @@ class BootSync:
# for tftp only ...
if distro.arch in [ "x86", "x86_64", "standard"]:
# pxelinux wants a file named $name under pxelinux.cfg
- f2 = os.path.join(self.settings.tftpboot, "pxelinux.cfg", f1)
+ f2 = os.path.join(self.bootloc, "pxelinux.cfg", f1)
if distro.arch == "ia64":
# elilo expects files to be named "$name.conf" in the root
# and can not do files based on the MAC address
@@ -771,7 +772,7 @@ class BootSync:
print _("Warning: Itanium system object (%s) needs an IP address to PXE") % system.name
filename = "%s.conf" % utils.get_config_filename(system,interface=name)
- f2 = os.path.join(self.settings.tftpboot, filename)
+ f2 = os.path.join(self.bootloc, filename)
f3 = os.path.join(self.settings.webdir, "systems", f1)
@@ -798,7 +799,7 @@ class BootSync:
if default is not None:
return
- fname = os.path.join(self.settings.tftpboot, "pxelinux.cfg", "default")
+ fname = os.path.join(self.bootloc, "pxelinux.cfg", "default")
# read the default template file
template_src = open("/etc/cobbler/pxedefault.template")
@@ -820,7 +821,7 @@ class BootSync:
# save the template.
metadata = { "pxe_menu_items" : pxe_menu_items }
- outfile = os.path.join(self.settings.tftpboot, "pxelinux.cfg", "default")
+ outfile = os.path.join(self.bootloc, "pxelinux.cfg", "default")
self.apply_template(template_data, metadata, outfile)
template_src.close()
diff --git a/cobbler/item.py b/cobbler/item.py
index dadcd239..f51f9599 100644
--- a/cobbler/item.py
+++ b/cobbler/item.py
@@ -51,7 +51,7 @@ class Item(serializable.Serializable):
self.clear(is_subobject) # reset behavior differs for inheritance cases
self.parent = '' # all objects by default are not subobjects
self.children = {} # caching for performance reasons, not serialized
-
+ self.owners = []
self.log_func = self.config.api.log
def clear(self):
@@ -117,6 +117,16 @@ class Item(serializable.Serializable):
self.name = name
return True
+ def set_owners(self,data):
+ """
+ The owners field is a comment unless using an authz module that pays attention to it,
+ like authz_ownership, which ships with Cobbler but is off by default. Consult the Wiki
+ docs for more info on CustomizableAuthorization.
+ """
+ owners = utils.input_string_or_list(data)
+ self.owners = owners
+ return True
+
def set_kernel_options(self,options):
"""
Kernel options are a space delimited list,
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index f52ad0b2..c40f002c 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -32,6 +32,7 @@ class Distro(item.Item):
Reset this object.
"""
self.name = None
+ self.owners = []
self.kernel = (None, '<<inherit>>')[is_subobject]
self.initrd = (None, '<<inherit>>')[is_subobject]
self.kernel_options = ({}, '<<inherit>>')[is_subobject]
@@ -60,6 +61,7 @@ class Distro(item.Item):
"""
self.parent = self.load_item(seed_data,'parent')
self.name = self.load_item(seed_data,'name')
+ self.owners = self.load_item(seed_data,'owners',[])
self.kernel = self.load_item(seed_data,'kernel')
self.initrd = self.load_item(seed_data,'initrd')
self.kernel_options = self.load_item(seed_data,'kernel_options')
@@ -165,7 +167,8 @@ class Distro(item.Item):
'breed' : self.breed,
'source_repos' : self.source_repos,
'parent' : self.parent,
- 'depth' : self.depth
+ 'depth' : self.depth,
+ 'owners' : self.owners
}
def printable(self):
@@ -181,6 +184,7 @@ class Distro(item.Item):
buf = buf + _("architecture : %s\n") % self.arch
buf = buf + _("ks metadata : %s\n") % self.ks_meta
buf = buf + _("breed : %s\n") % self.breed
+ buf = buf + _("owners : %s\n") % self.owners
return buf
def remote_methods(self):
@@ -191,7 +195,8 @@ class Distro(item.Item):
'kopts' : self.set_kernel_options,
'arch' : self.set_arch,
'ksmeta' : self.set_ksmeta,
- 'breed' : self.set_breed
+ 'breed' : self.set_breed,
+ 'owners' : self.set_owners
}
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index f229d4c3..3145b829 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -34,6 +34,7 @@ class Profile(item.Item):
Reset this object.
"""
self.name = None
+ self.owners = [] # should not be inheritable
self.distro = (None, '<<inherit>>')[is_subobject]
self.kickstart = (self.settings.default_kickstart , '<<inherit>>')[is_subobject]
self.kernel_options = ({}, '<<inherit>>')[is_subobject]
@@ -57,6 +58,7 @@ class Profile(item.Item):
self.parent = self.load_item(seed_data,'parent','')
self.name = self.load_item(seed_data,'name')
+ self.owners = self.load_item(seed_data,'owners',[])
self.distro = self.load_item(seed_data,'distro')
self.kickstart = self.load_item(seed_data,'kickstart')
self.kernel_options = self.load_item(seed_data,'kernel_options')
@@ -328,6 +330,7 @@ class Profile(item.Item):
"""
return {
'name' : self.name,
+ 'owners' : self.owners,
'distro' : self.distro,
'kickstart' : self.kickstart,
'kernel_options' : self.kernel_options,
@@ -342,7 +345,8 @@ class Profile(item.Item):
'virt_type' : self.virt_type,
'virt_path' : self.virt_path,
'dhcp_tag' : self.dhcp_tag,
- 'server' : self.server
+ 'server' : self.server,
+
}
def printable(self):
@@ -366,6 +370,7 @@ class Profile(item.Item):
buf = buf + _("repos : %s\n") % self.repos
buf = buf + _("dhcp tag : %s\n") % self.dhcp_tag
buf = buf + _("server : %s\n") % self.server
+ buf = buf + _("owners : %s\n") % self.owners
return buf
def remote_methods(self):
@@ -385,6 +390,7 @@ class Profile(item.Item):
'virt-bridge' : self.set_virt_bridge,
'virt-cpus' : self.set_virt_cpus,
'dhcp-tag' : self.set_dhcp_tag,
- 'server' : self.set_server
+ 'server' : self.set_server,
+ 'owners' : self.set_owners
}
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index a7b1f3b1..d65d09ba 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -161,6 +161,7 @@ class Repo(item.Item):
def to_datastruct(self):
return {
'name' : self.name,
+ 'owners' : self.owners,
'mirror' : self.mirror,
'keep_updated' : self.keep_updated,
'priority' : self.priority,
@@ -174,6 +175,7 @@ class Repo(item.Item):
def printable(self):
buf = _("repo : %s\n") % self.name
+ buf = buf + _("owners : %s\n") % self.owners
buf = buf + _("mirror : %s\n") % self.mirror
buf = buf + _("keep updated : %s\n") % self.keep_updated
buf = buf + _("priority : %s\n") % self.priority
@@ -210,6 +212,7 @@ class Repo(item.Item):
'priority' : self.set_priority,
'rpm-list' : self.set_rpm_list,
'createrepo-flags' : self.set_createrepo_flags,
- 'yumopts' : self.set_yumopts
+ 'yumopts' : self.set_yumopts,
+ 'owners' : self.set_owners
}
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index 936f1dd9..51dd0638 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -30,6 +30,7 @@ class System(item.Item):
def clear(self,is_subobject=False):
self.name = None
+ self.owners = None
self.profile = None
self.kernel_options = {}
self.ks_meta = {}
@@ -80,6 +81,7 @@ class System(item.Item):
self.parent = self.load_item(seed_data, 'parent')
self.name = self.load_item(seed_data, 'name')
+ self.owners = self.load_item(seed_data, 'owners')
self.profile = self.load_item(seed_data, 'profile')
self.kernel_options = self.load_item(seed_data, 'kernel_options', {})
self.ks_meta = self.load_item(seed_data, 'ks_meta', {})
@@ -336,6 +338,7 @@ class System(item.Item):
def to_datastruct(self):
return {
'name' : self.name,
+ 'owners' : self.set_owners,
'profile' : self.profile,
'kernel_options' : self.kernel_options,
'ks_meta' : self.ks_meta,
@@ -360,6 +363,7 @@ class System(item.Item):
buf = buf + _("virt type : %s\n") % self.virt_type
buf = buf + _("virt path : %s\n") % self.virt_path
buf = buf + _("server : %s\n") % self.server
+ buf = buf + _("owners : %s\n") % self.owners
counter = 0
for (name,x) in self.interfaces.iteritems():
@@ -405,6 +409,7 @@ class System(item.Item):
'virt-type' : self.set_virt_type,
'modify-interface' : self.modify_interface,
'delete-interface' : self.delete_interface,
- 'server' : self.set_server
+ 'server' : self.set_server,
+ 'owners' : self.set_owners
}
diff --git a/cobbler/modules/cli_distro.py b/cobbler/modules/cli_distro.py
index 35f5a4bd..9e0637f4 100644
--- a/cobbler/modules/cli_distro.py
+++ b/cobbler/modules/cli_distro.py
@@ -47,12 +47,15 @@ class DistroFunction(commands.CobblerFunction):
p.add_option("--name", dest="name", help="ex: 'RHEL-5-i386' (REQUIRED)")
+
if self.matches_args(args,["copy","rename"]):
p.add_option("--newname", dest="newname", help="for copy/rename commands")
if not self.matches_args(args,["remove","report","list"]):
p.add_option("--no-sync", action="store_true", dest="nosync", help="suppress sync for speed")
if not self.matches_args(args,["report","list"]):
p.add_option("--no-triggers", action="store_true", dest="notriggers", help="suppress trigger execution")
+ if not self.matches_args(args,["remove","report","list"]):
+ p.add_option("--owners", dest="owners", help="specify owners for authz_ownership module")
if self.matches_args(args,["remove"]):
p.add_option("--recursive", action="store_true", dest="recursive", help="also delete child objects")
@@ -73,6 +76,8 @@ class DistroFunction(commands.CobblerFunction):
obj.set_ksmeta(self.options.ksmeta)
if self.options.breed:
obj.set_breed(self.options.breed)
+ if self.options.owners:
+ obj.set_owners(self.options.owners)
return self.object_manipulator_finish(obj, self.api.distros, self.options)
diff --git a/cobbler/modules/cli_profile.py b/cobbler/modules/cli_profile.py
index e9d1d23b..9912607f 100644
--- a/cobbler/modules/cli_profile.py
+++ b/cobbler/modules/cli_profile.py
@@ -46,6 +46,7 @@ class ProfileFunction(commands.CobblerFunction):
p.add_option("--kopts", dest="kopts", help="ex: 'noipv6'")
p.add_option("--name", dest="name", help="a name for the profile (REQUIRED)")
+
if "copy" in args or "rename" in args:
p.add_option("--newname", dest="newname")
@@ -53,6 +54,7 @@ class ProfileFunction(commands.CobblerFunction):
p.add_option("--no-sync", action="store_true", dest="nosync", help="suppress sync for speed")
if not self.matches_args(args,["report", "list"]):
p.add_option("--no-triggers", action="store_true", dest="notriggers", help="suppress trigger execution")
+ p.add_option("--owners", dest="owners", help="specify owners for authz_ownership module")
if self.matches_args(args,["remove"]):
p.add_option("--recursive", action="store_true", dest="recursive", help="also delete child objects")
@@ -93,6 +95,9 @@ class ProfileFunction(commands.CobblerFunction):
if self.options.dhcp_tag: obj.set_dhcp_tag(self.options.dhcp_tag)
if self.options.server_override: obj.set_server(self.options.server)
+ if self.options.owners:
+ obj.set_owners(self.options.owners)
+
return self.object_manipulator_finish(obj, self.api.profiles, self.options)
diff --git a/cobbler/modules/cli_repo.py b/cobbler/modules/cli_repo.py
index 96afa6fc..88e45dd4 100644
--- a/cobbler/modules/cli_repo.py
+++ b/cobbler/modules/cli_repo.py
@@ -59,6 +59,8 @@ class RepoFunction(commands.CobblerFunction):
p.add_option("--no-sync", action="store_true", dest="nosync", help="suppress sync for speed")
if not self.matches_args(args,["report","list"]):
p.add_option("--no-triggers", action="store_true", dest="notriggers", help="suppress trigger execution")
+ if not self.matches_args(args,["remove","report","list"]):
+ p.add_option("--owners", dest="owners", help="specify owners for authz_ownership module")
def run(self):
@@ -75,6 +77,9 @@ class RepoFunction(commands.CobblerFunction):
if self.options.mirror: obj.set_mirror(self.options.mirror)
if self.options.yumopts: obj.set_yumopts(self.options.yumopts)
+ if self.options.owners:
+ obj.set_owners(self.options.owners)
+
return self.object_manipulator_finish(obj, self.api.repos, self.options)
diff --git a/cobbler/modules/cli_system.py b/cobbler/modules/cli_system.py
index c463b8c7..01ead353 100644
--- a/cobbler/modules/cli_system.py
+++ b/cobbler/modules/cli_system.py
@@ -63,6 +63,7 @@ class SystemFunction(commands.CobblerFunction):
if not self.matches_args(args,["remove","report","list"]):
+ p.add_option("--owners", dest="owners", help="specify owners for authz_ownership module")
p.add_option("--profile", dest="profile", help="name of cobbler profile (REQUIRED)")
p.add_option("--server-override", dest="server_override", help="overrides server value in settings file")
p.add_option("--subnet", dest="subnet", help="for static IP / templating usage")
@@ -99,6 +100,9 @@ class SystemFunction(commands.CobblerFunction):
if self.options.dhcp_tag: obj.set_dhcp_tag(self.options.dhcp_tag, my_interface)
if self.options.virt_bridge: obj.set_virt_bridge(self.options.virt_bridge, my_interface)
+ if self.options.owners:
+ obj.set_owners(self.options.owners)
+
return self.object_manipulator_finish(obj, self.api.systems, self.options)
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 495a4b57..e3d8a46b 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -58,7 +58,6 @@ DEFAULTS = {
"server" : "127.0.0.1",
"snippetsdir" : "/var/lib/cobbler/snippets",
"syslog_port" : 25150,
- "tftpboot" : -1, # special, see note below
"tftpd_bin" : "/usr/sbin/in.tftpd",
"tftpd_conf" : "/etc/xinetd.d/tftp",
"webdir" : "/var/www/cobbler",
@@ -109,11 +108,6 @@ class Settings(serializable.Serializable):
self._attributes = datastruct
- # this last attribute is special. In F9, the tftpboot location moves, so
- # what we have in settings is not (neccessarily) correct. So instead
- # of using settings we determine it by looking at the OS.
- self._attributes["tftpboot"] = utils.tftpboot_location()
-
return self
def __getattr__(self,name):
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 86ff41df..9c770d02 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -230,6 +230,20 @@ def find_kickstart(url):
return url
return None
+def input_string_or_list(options,delim=","):
+ """
+ Accepts a delimited list of stuff or a list, but always returns a list.
+ """
+ if options is None or options == "delete":
+ return []
+ elif type(options) == list:
+ return options
+ elif type(options) == str:
+ tokens = options.split(",")
+ return tokens
+ else:
+ raise CX(_("invalid input type"))
+
def input_string_or_hash(options,delim=","):
"""
Older cobbler files stored configurations in a flat way, such that all values for strings.
@@ -261,7 +275,7 @@ def input_string_or_hash(options,delim=","):
options.pop('',None)
return (True, options)
else:
- raise CX(_("Foreign options type"))
+ raise CX(_("invalid input type"))
def grab_tree(api_handle, obj):
"""
diff --git a/cobbler/webui/master.py b/cobbler/webui/master.py
index b2abf099..157b156a 100644
--- a/cobbler/webui/master.py
+++ b/cobbler/webui/master.py
@@ -33,8 +33,8 @@ VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
-__CHEETAH_genTime__ = 1205174715.425076
-__CHEETAH_genTimestamp__ = 'Mon Mar 10 14:45:15 2008'
+__CHEETAH_genTime__ = 1206550188.6649311
+__CHEETAH_genTimestamp__ = 'Wed Mar 26 12:49:48 2008'
__CHEETAH_src__ = 'webui_templates/master.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Feb 15 14:47:43 2008'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
diff --git a/docs/cobbler.pod b/docs/cobbler.pod
index a1f174f2..719850d3 100644
--- a/docs/cobbler.pod
+++ b/docs/cobbler.pod
@@ -102,6 +102,10 @@ arguments appropriately. Support for other types of distributions is possible
The file used for the answer file, regardless of the breed setting, is the value used for --kickstart when creating the profile.
+=item owners
+
+Users with small sites and a limited number of admins can probably ignore this option. All cobbler objects (distros, profiles, systems, and repos) can take a --owners parameter to specify what cobbler users can edit particular objects. This only applies to the Cobbler WebUI and XMLRPC interface, not the "cobbler" command line tool run from the shell. Furthermore, this is only respected by the "authz_ownership" module which must be enabled in /etc/cobbler/modules.conf. The value for --owners is a comma seperated list of users and groups as specified in /etc/cobbler/users.conf. For more information see the users.conf file as well as the Cobbler Wiki. In the default Cobbler configuration, this value is completely ignored, as is users.conf.
+
=back
=head2 ADDING A PROFILE
diff --git a/tests/tests.py b/tests/tests.py
index 99ba0b96..3fb41772 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -100,6 +100,41 @@ class BootTest(unittest.TestCase):
self.assertTrue(self.api.add_system(system))
self.assertTrue(self.api.find_system(name="drwily.rdu.redhat.com"))
+ repo = self.api.new_repo()
+ try:
+ os.makedirs("/tmp/test_example_cobbler_repo")
+ except:
+ pass
+ fd = open("/tmp/test_example_cobbler_repo/test.file", "w+")
+ fd.write("hello!")
+ fd.close()
+ self.assertTrue(repo.set_name("test_repo"))
+ self.assertTrue(repo.set_mirror("/tmp/test_example_cobbler_repo"))
+ self.assertTrue(self.api.repos().add(repo))
+
+
+class Ownership(BootTest):
+
+ def test_ownership_params(self):
+ return # FIXME
+
+ # NOTE: these tests are relaeively weak because they only test
+ # that the options are usable, not that they work, since cobbler
+ # as a command line tool ignores them, and cobblerd only cares
+ # in certain modes.
+ distro = self.api.find_distro(name="testdistro0")
+ profile = self.api.find_distro(name="testprofile0")
+ system = self.api.find_distro(name="drwily.rdu.redhat.com")
+ repo = self.api.find_repo(name="test_repo")
+ self.assertTrue(distro.set_owners("a,b"))
+ self.assertTrue(profile.set_owners("c,d"))
+ self.assertTrue(system.set_owners("e"))
+ self.assertTrue(repo.set_owners("f,g"))
+ self.api.add_distro(distro)
+ self.api.add_profile(profile)
+ self.api.add_system(system)
+ self.api.add_repo(repo)
+
class MultiNIC(BootTest):
def test_multi_nic_support(self):