summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/modules/cli_distro.py8
-rw-r--r--cobbler/modules/cli_image.py18
2 files changed, 17 insertions, 9 deletions
diff --git a/cobbler/modules/cli_distro.py b/cobbler/modules/cli_distro.py
index d6472940..793b0255 100644
--- a/cobbler/modules/cli_distro.py
+++ b/cobbler/modules/cli_distro.py
@@ -48,20 +48,20 @@ class DistroFunction(commands.CobblerFunction):
if not self.matches_args(args,["dumpvars","remove","report","list"]):
p.add_option("--arch", dest="arch", help="ex: x86, x86_64, ia64")
p.add_option("--breed", dest="breed", help="ex: redhat, debian, suse")
- p.add_option("--os-version", dest="os_version", help="ex: free format os version string")
if self.matches_args(args,["add"]):
p.add_option("--clobber", dest="clobber", help="allow add to overwrite existing objects", action="store_true")
if not self.matches_args(args,["dumpvars","remove","report","list"]):
p.add_option("--initrd", dest="initrd", help="absolute path to initrd.img (REQUIRED)")
+ if not self.matches_args(args,["find"]):
+ p.add_option("--in-place", action="store_true", default=False, dest="inplace", help="edit items in kopts or ksmeta without clearing the other items")
p.add_option("--kernel", dest="kernel", help="absolute path to vmlinuz (REQUIRED)")
p.add_option("--kopts", dest="kopts", help="ex: 'noipv6'")
p.add_option("--kopts-post", dest="kopts_post", help="ex: 'clocksource=pit'")
p.add_option("--ksmeta", dest="ksmeta", help="ex: 'blippy=7'")
- if not self.matches_args(args,["find"]):
- p.add_option("--in-place", action="store_true", default=False, dest="inplace", help="edit items in kopts or ksmeta without clearing the other items")
p.add_option("--name", dest="name", help="ex: 'RHEL-5-i386' (REQUIRED)")
-
+ if not self.matches_args(args,["dumpvars","remove","report","list"]):
+ p.add_option("--os-version", dest="os_version", help="ex: rhel4")
if self.matches_args(args,["copy","rename"]):
diff --git a/cobbler/modules/cli_image.py b/cobbler/modules/cli_image.py
index 13e2031a..515c12e9 100644
--- a/cobbler/modules/cli_image.py
+++ b/cobbler/modules/cli_image.py
@@ -38,18 +38,24 @@ class ImageFunction(commands.CobblerFunction):
def add_options(self, p, args):
+ if not self.matches_args(args,["dumpvars","remove","report","list"]):
+ p.add_option("--breed", dest="breed", help="ex: redhat")
+
if self.matches_args(args,["add"]):
p.add_option("--clobber", dest="clobber", help="allow add to overwrite existing objects", action="store_true")
- p.add_option("--name", dest="name", help="ex: 'LemurSoft-v3000' (REQUIRED)")
+ p.add_option("--name", dest="name", help="ex: 'LemurSoft-v3000' (REQUIRED)")
if not self.matches_args(args,["dumpvars","remove","report","list"]):
- p.add_option("--file", dest="file", help="common filesystem path to image for all hosts (nfs is good)")
- p.add_option("--image-type", dest="image_type", help="what kind of image is this?")
+ p.add_option("--file", dest="file", help="common filesystem path to image for all hosts (nfs is good)")
+ p.add_option("--image-type", dest="image_type", help="what kind of image is this?")
+
+ if not self.matches_args(args,["dumpvars","remove","report","list"]):
+ p.add_option("--os-version", dest="os_version", help="ex: rhel4")
if self.matches_args(args,["copy","rename"]):
- p.add_option("--newname", dest="newname", help="used for copy/edit")
+ p.add_option("--newname", dest="newname", help="used for copy/edit")
if not self.matches_args(args,["dumpvars","find","remove","report","list"]):
# FIXME: there's really nothing to sync here. Remove?
@@ -98,7 +104,9 @@ class ImageFunction(commands.CobblerFunction):
if self.options.virt_ram: obj.set_virt_ram(self.options.virt_ram)
if self.options.virt_type: obj.set_virt_type(self.options.virt_type)
if self.options.xml_file: obj.set_xml_file(self.options.xml_file)
-
+ if self.options.breed: obj.set_breed(self.options.breed)
+ if self.options.os_version: obj.set_os_version(self.options.os_version)
+
return self.object_manipulator_finish(obj, self.api.images, self.options)