diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-03-26 16:02:48 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-03-26 16:02:48 -0400 |
commit | 602591cae12323012693f49de3ba59516b40c3f5 (patch) | |
tree | f24231c3cb9badc6809f57b5de1d2080688a5aac /cobbler/modules | |
parent | a6a82750ac3cab01fbafdd689a7ea1f5f6dc0bf7 (diff) | |
download | third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.tar.gz third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.tar.xz third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.zip |
Add a --owner to all the objects, plus associated API calls and backend stuff, for use with the (pending real soon now)
authz_ownership module. Also updated docs. Incidentally, self.settings.tftpboot is now utils.tftpboot_location() --
which is required because tftpboot moves around. Previously this was masked to still look like a settings variable
but I decided to remove the hack. All code using that location has been updated appropriately.
Diffstat (limited to 'cobbler/modules')
-rw-r--r-- | cobbler/modules/cli_distro.py | 5 | ||||
-rw-r--r-- | cobbler/modules/cli_profile.py | 5 | ||||
-rw-r--r-- | cobbler/modules/cli_repo.py | 5 | ||||
-rw-r--r-- | cobbler/modules/cli_system.py | 4 |
4 files changed, 19 insertions, 0 deletions
diff --git a/cobbler/modules/cli_distro.py b/cobbler/modules/cli_distro.py index 35f5a4b..9e0637f 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 e9d1d23..9912607 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 96afa6f..88e45dd 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 c463b8c..01ead35 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) |