Revision 3c286190 lib/config.py
b/lib/config.py | ||
---|---|---|
115 | 115 |
ec_reserved.update(self._ec_reserved[ec_id]) |
116 | 116 |
return ec_reserved |
117 | 117 |
|
118 |
|
|
119 | 118 |
def Generate(self, existing, generate_one_fn, ec_id): |
120 | 119 |
"""Generate a new resource of this type |
121 | 120 |
|
... | ... | |
162 | 161 |
|
163 | 162 |
return result |
164 | 163 |
|
164 |
|
|
165 | 165 |
def _GenerateMACSuffix(): |
166 | 166 |
"""Generate one mac address |
167 | 167 |
|
... | ... | |
241 | 241 |
if nobj.mac_prefix: |
242 | 242 |
prefix = nobj.mac_prefix |
243 | 243 |
suffix = view_func(*args, **kwargs) |
244 |
return prefix+':'+suffix
|
|
244 |
return prefix + ':' + suffix
|
|
245 | 245 |
return wraps(view_func)(_decorator) |
246 | 246 |
return _get_mac_prefix |
247 | 247 |
|
... | ... | |
391 | 391 |
|
392 | 392 |
return self._temporary_ips.Reserve(ec_id, ('reserve', address, net_uuid)) |
393 | 393 |
|
394 |
|
|
395 | 394 |
@locking.ssynchronized(_config_lock, shared=1) |
396 | 395 |
def ReserveIp(self, net, address, ec_id): |
397 | 396 |
"""Reserve a given IPv4 address for use by an instance. |
... | ... | |
1444 | 1443 |
# Return all IP addresses to the respective address pools |
1445 | 1444 |
self._UnlockedCommitIp('release', net_uuid, nic.ip) |
1446 | 1445 |
|
1447 |
|
|
1448 | 1446 |
del self._config_data.instances[instance_name] |
1449 | 1447 |
self._config_data.cluster.serial_no += 1 |
1450 | 1448 |
self._WriteConfig() |
... | ... | |
2546 | 2544 |
""" |
2547 | 2545 |
return self._UnlockedGetGroupNetParams(net, node) |
2548 | 2546 |
|
2549 |
|
|
2550 | 2547 |
@locking.ssynchronized(_config_lock, shared=1) |
2551 | 2548 |
def CheckIPInNodeGroup(self, ip, node): |
2552 | 2549 |
"""Check for conflictig IP. |
Also available in: Unified diff