Revision 332d0e37
b/lib/config.py | ||
---|---|---|
269 | 269 |
ports[net_port] = [] |
270 | 270 |
ports[net_port].append((instance.name, "network port")) |
271 | 271 |
|
272 |
# instance disk verify |
|
273 |
for idx, disk in enumerate(instance.disks): |
|
274 |
result.extend(["instance '%s' disk %d error: %s" % |
|
275 |
(instance.name, idx, msg) for msg in disk.Verify()]) |
|
276 |
|
|
272 | 277 |
# cluster-wide pool of free ports |
273 | 278 |
for free_port in data.cluster.tcpudp_port_pool: |
274 | 279 |
if free_port not in ports: |
b/lib/objects.py | ||
---|---|---|
497 | 497 |
val += ", size=%dm)>" % self.size |
498 | 498 |
return val |
499 | 499 |
|
500 |
def Verify(self): |
|
501 |
"""Checks that this disk is correctly configured. |
|
502 |
|
|
503 |
""" |
|
504 |
errors = [] |
|
505 |
if self.mode not in constants.DISK_ACCESS_SET: |
|
506 |
errors.append("Disk access mode '%s' is invalid" % (self.mode, )) |
|
507 |
return errors |
|
508 |
|
|
500 | 509 |
|
501 | 510 |
class Instance(TaggableObject): |
502 | 511 |
"""Config object representing an instance.""" |
Also available in: Unified diff