diff --git a/lib/cmdlib.py b/lib/cmdlib.py index a90d201a35b9aba2a7e7cf5b1da86050d49ee02e..2907e46f78610658233653fdb606ceee01170f65 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3508,11 +3508,20 @@ class LUQueryInstances(NoHooksLU): elif field == "disk_template": val = instance.disk_template elif field == "ip": - val = instance.nics[0].ip + if instance.nics: + val = instance.nics[0].ip + else: + val = None elif field == "bridge": - val = instance.nics[0].bridge + if instance.nics: + val = instance.nics[0].bridge + else: + val = None elif field == "mac": - val = instance.nics[0].mac + if instance.nics: + val = instance.nics[0].mac + else: + val = None elif field == "sda_size" or field == "sdb_size": idx = ord(field[2]) - ord('a') try: diff --git a/lib/objects.py b/lib/objects.py index 2bae5634ef8330797211a0c823647c39c50f593a..2e64a0466d76825f62d41609046c0461b4068f5e 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -832,7 +832,7 @@ class Cluster(TaggableObject): def FillHV(self, instance): """Fill an instance's hvparams dict. - @type instance: object + @type instance: L{objects.Instance} @param instance: the instance parameter to fill @rtype: dict @return: a copy of the instance's hvparams with missing keys filled from @@ -845,7 +845,7 @@ class Cluster(TaggableObject): def FillBE(self, instance): """Fill an instance's beparams dict. - @type instance: object + @type instance: L{objects.Instance} @param instance: the instance parameter to fill @rtype: dict @return: a copy of the instance's beparams with missing keys filled from diff --git a/man/gnt-cluster.sgml b/man/gnt-cluster.sgml index 13bdf03a3365402032f376ee997df2da7bae29f5..e3fecbf35f2833b41e23a455465f3edd0797dbd7 100644 --- a/man/gnt-cluster.sgml +++ b/man/gnt-cluster.sgml @@ -373,7 +373,7 @@ </para> <para> - The <option>--backend</option> option allows you to set + The <option>--backend-parameters</option> option allows you to set the default backend parameters for the cluster. The parameter format is a comma-separated list of key=value pairs with the following supported keys: