summaryrefslogtreecommitdiffstats
path: root/cobbler/cobbler_msg.py
blob: d9f3183d520233e5e998c7ead13446a3948b8405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# -*- coding: iso-8859-15 -*-

"""
Messages used by cobbler.
This module encapsulates strings so they can
be reused and potentially translated.

Copyright 2006, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>

This software may be freely redistributed under the terms of the GNU
general public license.

You should have received a copy of the GNU General Public License
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>]
    [--virt-file-size=<gigabytes>]
    [--virt-ram=<megabytes>]

cobbler system add --name=<ip│mac│hostname|default> --profile=<string>
    [--pxe-address=<string>]
    [--ksmeta=<string>]

cobbler import --name=<string> --mirror=rsync://<address>
cobbler import --name=<string> --mirror=user@address:/path
cobbler import --name=<string> --mirror=<path>

cobbler repo add --name=<string> --mirror=rsync://<address> [--local-file=name]
cobbler repo add --name=<string> --mirror=user@address:/path [--local-file=name]
cobbler reposync

cobbler [distro|profile|system] remove --name=<name>

cobbler list

cobbler sync

cobbler enchant --address=<ip|hostname> [--profile=<string>|--system=<string>]

cobbler status
"""

_msg_table = {
  "system"          : "System",
  "profile"         : "Profile",
  "distribution"    : "Distribution",
  "bad_server"      : "The 'server' field in /var/lib/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it",
  "bad_next"        : "For PXE to be functional, the 'next_server' field in /var/lib/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.",
  "parse_error"     : "cobbler could not read %s, replacing...",
  "no_ssh"          : "cobbler can't read ~/.ssh/id_dsa.pub",
  "exc_koan_path"   : "koan_path in /var/lib/cobbler/settings is invalid",
  "no_rename"       : "objects can not be renamed using the edit command",
  "no_create"       : "cobbler could not create: %s",
  "no_delete"       : "cobbler could not delete: %s",
  "no_args"         : "this command requires arguments.",
  "missing_options" : "cannot perform this action, more arguments are required",
  "enchant_failed"  : "enchant failed (%s)",
  "import_failed"   : "import failed (%s)",
  "unknown_cmd"     : "cobbler doesn't understand '%s'",
  "bad_arg"         : "cobbler was expecting an equal sign in argument '%s'",
  "reject_arg"      : "the value of parameter '%s' isn't valid",
  "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",
  "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",
  "no_dhcpd"        : "cobbler couldn't find dhcpd, try 'yum install dhcp'",
  "no_dnsmasq"      : "cobbler couldn't find dnsmasq, try 'yum install dnsmasq'",
  "dhcp_choice"     : "manage_dhcp_mode in /var/lib/cobbler/settings should be 'isc' or 'dnsmasq'",
  "no_bootloader"   : "missing 1 or more bootloader files listed in /var/lib/cobbler/settings",
  "no_tftpd"        : "cobbler couldn't find tftpd, try 'yum install tftpd-server'",
  "no_dir"          : "cobbler couldn't find %s, please create it",
  "no_mirror"       : "mirror URL is not valid",
  "chg_attrib"      : "need to change field '%s' value to '%s' in file '%s'",
  "no_exist"        : "file %s does not exist",
  "no_exist2"       : "path %s does not exist",
  "no_next_server"  : "file '%s' should have a next-server line",
  "no_filename"     : "file '%s' should have a filename line",
  "no_dir2"         : "can't find %s for %s as referenced in /var/lib/cobbler/settings",
  "bad_param"       : "at least one parameter is missing for this function",
  "empty_list"      : "There are no configured %s records.",
  "err_resolv"      : "The system name (%s) did not resolve",
  "err_kickstart"   : "The kickstart (%s) for item (%s) is not valid",
  "err_kickstart2"  : "Error while mirroring kickstart file (%s) to (%s)",
  "orphan_profile"  : "Removing this system would break profile '%s'",
  "orphan_profile2" : "system (%s) references a non-existant profile (%s)",
  "orphan_distro2"  : "profile (%s) references a non-existant distro (%s)",
  "orphan_system"   : "Removing this profile would break system '%s'",
  "delete_nothing"  : "can't delete something that doesn't exist",
  "no_distro"       : "distro does not exist",
  "no_system"       : "system does not exist",
  "no_repo"         : "repository %s does not exist",
  "no_repos"        : "one of the listed repositories is not defined in cobbler",
  "no_profile"      : "profile does not exist",
  "no_kickstart"    : "kickstart must be an absolute path, or an http://, ftp:// or nfs:// URL",
  "no_kernel"       : "cannot find kernel file",
  "sync_kernel"     : "the kernel (%s) for distro (%s) cannot be found and must be fixed",
  "sync_initrd"     : "the initrd (%s) for distro (%s) cannot be found and must be fixed",
  "sync_mirror_ks"  : "mirroring local kickstarts...",
  "sync_buildtree"  : "building trees",
  "sync_processing" : "processing: %s",
  "writing"         : "writing file: %s",
  "mkdir"           : "creating: %s",
  "copying"         : "copying file: %s to %s",
  "removing"        : "removing: %s",
  "no_initrd"       : "cannot find initrd",
  "exc_breed"       : "invalid breed: try redhat or suse",
  "exc_virt_name"   : "invalid name for virtual image",
  "exc_virt_file"   : "invalid file size for virtual image",
  "exc_virt_ram"    : "invalid RAM size for virtual image",
  "exc_virt_mac"    : "invalid MAC address for virtual image",
  "exc_virt_para"   : "invalid paravirtualization setting",
  "exc_profile"     : "invalid profile name",
  "exc_profile2"    : "profile name not set",
  "exc_pxe_arch"    : "valid PXE architectures: standard or ia64",
  "exc_no_template" : "can't read template file (%s)",
  "exc_dhcp_nomac"  : "when cobbler is managing dhcpd.conf, all system names must be MAC addresses.  Aborting.",
  "exc_ia64_noip"   : "due to an IA64 bootloader limitation, system (%s) must define a pxe-address value (which is an IP address)",
  "exc_kopts"       : "Kernel options should be a space delimited list of values and key=value pairs",
  "lock"            : "Locked.  If cobbler is currently running, wait for termination, otherwise remove /var/lib/cobbler/lock",
  "check_ok"        : """
No setup problems found.

Manual review and editing of /var/lib/cobbler/settings is recommended to tailor cobbler to your particular configuration.

Good luck.
"""
}

def lookup(key):
   """
   Return the lookup of a string key.
   """
   if _msg_table.has_key(key):
       return _msg_table[key]
   return key