Revision 433d2933
b/lib/objects.py | ||
---|---|---|
1074 | 1074 |
" '%s', error: %s" % (key, value, err)) |
1075 | 1075 |
|
1076 | 1076 |
|
1077 |
def GetOSImage(osparams): |
|
1078 |
"""Gets the OS image value from the OS parameters. |
|
1079 |
|
|
1080 |
@type osparams: L{dict} or NoneType |
|
1081 |
@param osparams: OS parameters or None |
|
1082 |
|
|
1083 |
@rtype: string or NoneType |
|
1084 |
@return: |
|
1085 |
value of OS image contained in OS parameters, or None if the OS |
|
1086 |
parameters are None or the OS parameters do not contain an OS |
|
1087 |
image |
|
1088 |
|
|
1089 |
""" |
|
1090 |
if osparams is None: |
|
1091 |
return None |
|
1092 |
else: |
|
1093 |
return osparams.get("os-image", None) |
|
1094 |
|
|
1095 |
|
|
1096 |
def PutOSImage(osparams, os_image): |
|
1097 |
"""Update OS image value in the OS parameters |
|
1098 |
|
|
1099 |
@type osparams: L{dict} |
|
1100 |
@param osparams: OS parameters |
|
1101 |
|
|
1102 |
@type os_image: string |
|
1103 |
@param os_image: OS image |
|
1104 |
|
|
1105 |
@rtype: NoneType |
|
1106 |
@return: None |
|
1107 |
|
|
1108 |
""" |
|
1109 |
osparams["os-image"] = os_image |
|
1110 |
|
|
1111 |
|
|
1077 | 1112 |
class Instance(TaggableObject): |
1078 | 1113 |
"""Config object representing an instance.""" |
1079 | 1114 |
__slots__ = [ |
Also available in: Unified diff