Revision 7c4c22f5 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2535 | 2535 |
if new_ip != old_ip: |
2536 | 2536 |
if netutils.TcpPing(new_ip, constants.DEFAULT_NODED_PORT): |
2537 | 2537 |
raise errors.OpPrereqError("The given cluster IP address (%s) is" |
2538 |
" reachable on the network. Aborting." %
|
|
2538 |
" reachable on the network" % |
|
2539 | 2539 |
new_ip, errors.ECODE_NOTUNIQUE) |
2540 | 2540 |
|
2541 | 2541 |
self.op.name = new_name |
... | ... | |
3668 | 3668 |
] |
3669 | 3669 |
|
3670 | 3670 |
def CheckArguments(self): |
3671 |
self.primary_ip_family = self.cfg.GetPrimaryIPFamily() |
|
3671 | 3672 |
# validate/normalize the node name |
3672 | 3673 |
self.hostname = netutils.GetHostname(name=self.op.node_name, |
3673 |
family=self.cfg.GetPrimaryIPFamily())
|
|
3674 |
family=self.primary_ip_family)
|
|
3674 | 3675 |
self.op.node_name = self.hostname.name |
3675 | 3676 |
|
3676 | 3677 |
def BuildHooksEnv(self): |
... | ... | |
3705 | 3706 |
node = hostname.name |
3706 | 3707 |
primary_ip = self.op.primary_ip = hostname.ip |
3707 | 3708 |
if self.op.secondary_ip is None: |
3709 |
if self.primary_ip_family == netutils.IP6Address.family: |
|
3710 |
raise errors.OpPrereqError("When using a IPv6 primary address, a valid" |
|
3711 |
" IPv4 address must be given as secondary", |
|
3712 |
errors.ECODE_INVAL) |
|
3708 | 3713 |
self.op.secondary_ip = primary_ip |
3709 | 3714 |
|
3710 | 3715 |
secondary_ip = self.op.secondary_ip |
... | ... | |
6994 | 6999 |
elif ip.lower() == constants.VALUE_AUTO: |
6995 | 7000 |
if not self.op.name_check: |
6996 | 7001 |
raise errors.OpPrereqError("IP address set to auto but name checks" |
6997 |
" have been skipped. Aborting.",
|
|
7002 |
" have been skipped", |
|
6998 | 7003 |
errors.ECODE_INVAL) |
6999 | 7004 |
nic_ip = self.hostname1.ip |
7000 | 7005 |
else: |
Also available in: Unified diff