summaryrefslogtreecommitdiffstats
path: root/cobbler/utils.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-08 11:42:41 -0400
committerJim Meyering <jim@meyering.net>2006-05-08 11:42:41 -0400
commit038a4383ccb6230f927960a34288c5cf6fbd3455 (patch)
treec7264ec2a325ed8d74c260b31111df934a87960f /cobbler/utils.py
parentfde48f2d1dc6412a0e9e483da8d197fd8c5d8e53 (diff)
downloadthird_party-cobbler-038a4383ccb6230f927960a34288c5cf6fbd3455.tar.gz
third_party-cobbler-038a4383ccb6230f927960a34288c5cf6fbd3455.tar.xz
third_party-cobbler-038a4383ccb6230f927960a34288c5cf6fbd3455.zip
More pychecker. More comments.
Diffstat (limited to 'cobbler/utils.py')
-rw-r--r--cobbler/utils.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 341bef5..c6cc019 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -12,20 +12,27 @@ import subprocess
import msg
-app_debug = False # essentially an app level global, but the only one
-
_re_kernel = re.compile(r'vmlinuz-(\d+)\.(\d+)\.(\d+)-(.*)')
_re_initrd = re.compile(r'initrd-(\d+)\.(\d+)\.(\d+)-(.*).img')
-utils_last_error = ""
+_utils_last_error = ""
def last_error():
- return utils_last_error
+ """
+ Return the last error message set with set_error
+ """
+ return _utils_last_error
def set_error(strmsg):
- global utils_last_error
- utils_last_error = msg.m(strmsg)
+ """
+ Set the error message for the last failed operation
+ """
+ global _utils_last_error
+ _utils_last_error = msg.m(strmsg)
def get_host_ip(ip):
+ """
+ Return the IP encoding needed for the TFTP boot tree.
+ """
handle = subprocess.Popen("/usr/bin/gethostip %s" % ip, shell=True, stdout=subprocess.PIPE)
out = handle.stdout
results = out.read()