diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-05-08 11:19:46 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-05-08 11:19:46 -0400 |
commit | fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53 (patch) | |
tree | 1af94dc01339be06d7b339b87f55e87503052553 /cobbler/item_profile.py | |
parent | d3f5db5d15a74c9149d86a2a73317365d726beba (diff) | |
download | third_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.tar.gz third_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.tar.xz third_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.zip |
PyChecker.
Diffstat (limited to 'cobbler/item_profile.py')
-rw-r--r-- | cobbler/item_profile.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py index f84f241..4709479 100644 --- a/cobbler/item_profile.py +++ b/cobbler/item_profile.py @@ -1,5 +1,6 @@ """ -A Cobbler Profile. +A Cobbler Profile. A profile is a reference to a distribution, possibly some kernel +options, possibly some Xen options, and some kickstart data. Michael DeHaan <mdehaan@redhat.com> """ @@ -11,10 +12,16 @@ from msg import * class Profile(item.Item): def __init__(self,config): + """ + Constructor. Requires a backreference to Config. + """ self.config = config self.clear() def clear(self): + """ + Reset this object. + """ self.name = None self.distro = None # a name, not a reference self.kickstart = None @@ -26,6 +33,9 @@ class Profile(item.Item): self.xen_paravirt = True def from_datastruct(self,seed_data): + """ + Load this object's properties based on seed_data + """ self.name = seed_data['name'] self.distro = seed_data['distro'] self.kickstart = seed_data['kickstart'] @@ -82,7 +92,7 @@ class Profile(item.Item): For Xen only. Specifies the size of the Xen image in gigabytes. xen-net-install may contain some logic to ignore 'illogical' values of this size, - though there are no guarantees. 0 tells xen-net-install to just + though there are no guarantees. 0 tells koan to just let it pick a semi-reasonable size. When in doubt, specify the size you want. """ @@ -147,6 +157,9 @@ class Profile(item.Item): return True def to_datastruct(self): + """ + Return hash representation for the serializer + """ return { 'name' : self.name, 'distro' : self.distro, @@ -160,6 +173,9 @@ class Profile(item.Item): } def printable(self): + """ + A human readable representaton + """ buf = "" buf = buf + "profile : %s\n" % self.name buf = buf + "distro : %s\n" % self.distro @@ -171,3 +187,4 @@ class Profile(item.Item): buf = buf + "xen mac : %s" % self.xen_mac buf = buf + "xen paravirt : %s" % self.xen_paravirt return buf + |