summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-16 15:24:33 -0400
committerJim Meyering <jim@meyering.net>2006-10-16 15:24:33 -0400
commitdc989463760d19c1e0ad41c0b6317f9753b93ac3 (patch)
treec13a74df332aea4b6f9dd36a5497c5cf5160007c
parentcd25b94d8ef552abed683c5e29a8bde1102f492b (diff)
downloadthird_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.tar.gz
third_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.tar.xz
third_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.zip
Finally added a "usage" function to the CLI.
Minor manpage cleanup.
-rw-r--r--cobbler.pod24
-rwxr-xr-xcobbler/cobbler.py5
-rw-r--r--cobbler/cobbler_msg.py35
3 files changed, 48 insertions, 16 deletions
diff --git a/cobbler.pod b/cobbler.pod
index be8b656..b17d2bc 100644
--- a/cobbler.pod
+++ b/cobbler.pod
@@ -40,8 +40,6 @@ B<cobbler distro add --name=<string> --kernel=<path> --initrd=<path> [--kopts=<s
=over
-=over
-
=item name
a string identifying the distribution
@@ -80,8 +78,6 @@ See the section below on templating.
=back
-=back
-
=head2 ADDING A PROFILE
A profile associates a distribution to additional specialized options, such as a kickstart automation file. Profiles are the core unit of provisioning and at least one profile must exist for every distribution to be provisioned.
@@ -90,8 +86,6 @@ B<cobbler profile add --name=<string> --distro=<string> [--kickstart=<url>] [--k
=over
-=over
-
Arguments are as listed for distributions, except for the "arch" parameter, and with the additions listed below:
=item distro
@@ -117,15 +111,11 @@ multiple images on a machine will cause increasing numbers to be appended to thi
=back
-=back
-
-
=head2 ADDING A SYSTEM
Systems assign a piece of hardware with the cobbler profile to be assigned to it. Systems can be defined by hostname, IP, or MAC address. When available, use of the MAC address to assign systems is preferred.
B<cobbler system add --name=<ip|mac|hostname> --profile=<string> [--kopts=<string>] [--pxe-address=<string>] [--ksmeta=<string>]
-=over
=over
@@ -180,6 +170,8 @@ Configuration changes made with cobbler commands such as "add/edit" or "delete/r
To create a provisioning infrastructure from a distribution mirror.
+=over
+
B<cobbler check>
B<cobbler import --mirror=rsync://yourfavoritemirror.com/foo --mirror-name=anyname>
@@ -192,8 +184,12 @@ B<cobbler system add --name=AA:BB:CC:DD:EE:FF --profile=name_of_a_profile2>
B<cobbler sync>
+=back
+
=head2 NORMAL WORKFLOW
+=over
+
B<cobbler check>
B<cobbler distro add --name=rhel4u3 --kernel=/dir1/vmlinuz --initrd=/dir1/initrd.img>
@@ -212,9 +208,13 @@ B<cobbler list>
B<cobbler sync>
+=back
+
=head2 XEN
-For Xen, be sure the distro uses a Xen kernel and initrd:
+For Xen, be sure the distro uses a Xen kernel and initrd and follow similar steps as above, adding additional parameters as desired:
+
+=over
B<cobbler distro add --name=fc5xen --kernel=/dir3/vmlinuz --initrd=/dir6/initrd.img>
@@ -226,6 +226,8 @@ And define systems (if desired) using MAC addresses, not IP's or hostnames:
B<cobbler system add --name=AA:BB:CC:DD:EE:FE --profile=xenwebservers>
+=back
+
=head1 ADVANCED TOPICS
=head2 KICKSTART TEMPLATING
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index 82d6a14..b6d082d 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -81,7 +81,7 @@ class BootCLI:
"""
Print out abbreviated help if user gives bad syntax
"""
- raise cexceptions.CobblerException("usage")
+ print cobbler_msg.USAGE
def list(self,args):
all = [ self.api.settings(), self.api.distros(),
@@ -260,7 +260,8 @@ class BootCLI:
feed it the remaining args[1:-1] as arguments.
"""
if args is None or len(args) == 0:
- raise cexceptions.CobblerException("help")
+ print cobbler_msg.USAGE
+ return True
if args[0] in commands:
commands[args[0]](args[1:])
else:
diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py
index 5f9ea91..d9d904d 100644
--- a/cobbler/cobbler_msg.py
+++ b/cobbler/cobbler_msg.py
@@ -1,3 +1,5 @@
+# -*- coding: iso-8859-15 -*-
+
"""
Messages used by cobbler.
This module encapsulates strings so they can
@@ -14,6 +16,35 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
+USAGE = """cobbler provisioning tool
+basic usage guide / see "man cobbler" for more.
+
+cobbler check
+
+cobbler distro add --name=<string> --kernel=<path> --initrd=<path>
+ [--kopts=<string>] [--ksmeta=<string>] [--arch=<x86|x86_64|ia64>]
+
+cobbler profile add --name=<string --distro=<string>
+ [--kick-start=<url>] [--kopts=<string>] [--ksmeta=<string>]
+ [--xen-name=<string>] [--xen-file-size=<gigabytes>]
+ [--xen-ram=<megabytes>]
+
+cobbler system add --name=<ip│mac│hostname|default> --profile=<string>
+ [--pxe-address=<string>]
+ [--ksmeta=<string>]
+
+cobbler import --mirror=rsync://<address> --mirror-name=<string>
+cobbler import --path=<path>
+
+cobbler [distro|profile|system] remove --name=<name>
+
+cobbler list
+
+cobbler sync
+
+cobbler system enchant --name=<string> [--password=<string>]
+"""
+
_msg_table = {
"system" : "System",
"profile" : "Profile",
@@ -35,7 +66,6 @@ _msg_table = {
"weird_arg" : "this command doesn't take a parameter named '%s'",
"bad_sys_name" : "system name must be a MAC, IP, or resolveable host",
"bad_ip" : "argument must be an IP address",
- "usage" : "for help, see 'man cobbler'",
"need_to_fix" : "the following potential problems were detected:",
"need_perms" : "cobbler could not access %s",
"need_perms2" : "cobbler could not copy %s to %s",
@@ -91,8 +121,7 @@ No setup problems found.
Manual review and editing of /var/lib/cobbler/settings is recommended to tailor cobbler to your particular configuration.
Good luck.
-""",
- "help" : "see 'man cobbler'"
+"""
}
def lookup(key):