Revision c6f1af07 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
722 | 722 |
_CheckNicsBridgesExist(lu, instance.nics, node) |
723 | 723 |
|
724 | 724 |
|
725 |
def _CheckOSVariant(os, name): |
|
725 |
def _CheckOSVariant(os_obj, name):
|
|
726 | 726 |
"""Check whether an OS name conforms to the os variants specification. |
727 | 727 |
|
728 |
@type os: L{objects.OS} |
|
729 |
@param os: OS object to check |
|
728 |
@type os_obj: L{objects.OS}
|
|
729 |
@param os_obj: OS object to check
|
|
730 | 730 |
@type name: string |
731 | 731 |
@param name: OS name passed by the user, to check for validity |
732 | 732 |
|
733 | 733 |
""" |
734 |
if not os.supported_variants: |
|
734 |
if not os_obj.supported_variants:
|
|
735 | 735 |
return |
736 | 736 |
try: |
737 | 737 |
variant = name.split("+", 1)[1] |
738 | 738 |
except IndexError: |
739 | 739 |
raise errors.OpPrereqError("OS name must include a variant") |
740 | 740 |
|
741 |
if variant not in os.supported_variants: |
|
741 |
if variant not in os_obj.supported_variants:
|
|
742 | 742 |
raise errors.OpPrereqError("Unsupported OS variant") |
743 | 743 |
|
744 | 744 |
|
Also available in: Unified diff