[Yahoo-eng-team] [Bug 1843502] Re: Network config is incorrectly parsed when nameservers are specified

2019-09-11 Thread Ryan Harper
Issue is related to local changes, marking invalid.

** Changed in: cloud-init
   Status: Incomplete => Invalid

** Changed in: cloud-init (Suse)
   Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1843502

Title:
  Network config is incorrectly parsed when  nameservers are specified

Status in cloud-init:
  Invalid
Status in cloud-init package in Suse:
  Invalid

Bug description:
  The issue was reproduced on Azure with cloud-init 19.1 on a SLES12 SP4 
machine. Looking at the code, the same behavior could be reproduced on any 
other configuration where the cloud provider specifies nameservers in the 
network configuration.
  The specified nameservers in network configuration are ignored and cloud-init 
raises an error.
  In network_state.py the function _v2_common builds a name_cmd dictionary 
which is then passed to the function handle_nameserver. The handle_nameserver 
has a decorator that enforces that passed in dictionary to have the key 
"address". But the _v2_common build a dictionary that has the key "addresses" 
instead. That results in raising an error.
  Here's a snapshot of the cloud-init.log

  2019-09-09 16:21:29,479 - network_state.py[DEBUG]: v2(nameserver) -> 
v1(nameserver):
  {'search': 'xkf00b0rtzgejkug4xc2pcinre.xx.internal.cloudapp.net', 'type': 
'nameserver', 'addresses': '168.63.129.16'}
  2019-09-09 16:21:29,479 - network_state.py[WARNING]: Skipping invalid 
command: {'nameservers': {'search': 
'xkf00b0rtzgejkug4xc2pcinre.xx.internal.cloudapp.net', 'addresses': 
'168.63.129.16'}, 'eth0': {'set-name': 'eth0', 'match': {'macaddress': 
u'00:0d:3a:6d:ca:25'}, 'dhcp4': True}}
  Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 321, in parse_config_v2
  self._v2_common(command)
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 697, in _v2_common
  self.handle_nameserver(name_cmd)
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 118, in decorator
  required_keys))
  InvalidCommand: Command missing set(['address']) of required keys ['address']

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1843502/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1843502] Re: Network config is incorrectly parsed when nameservers are specified

2019-09-11 Thread Ryan Harper
Thanks for the bug and the logs.  Looking at the network-config that was
generated:

>>> print(yaml.dump(nc, default_flow_style=False, indent=4))
ethernets:
eth0:
dhcp4: true
match:
macaddress: 00:0d:3a:6d:ca:25
set-name: eth0
nameservers:
addresses: 168.63.129.16
search: xkf00b0rtzgejk

The bug is that nameservers needs to be indented *under* eth0.

However, cloud-init upstream does not parse or process nameservers[1]
from Azure metadata, so I can't understand why you have this bug unless
the cloud-init 19.1 on SLES has some downstream patches.

1. https://git.launchpad.net/cloud-
init/tree/cloudinit/sources/DataSourceAzure.py#n1305


** Changed in: cloud-init
   Status: New => Incomplete

** Also affects: cloud-init (Suse)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1843502

Title:
  Network config is incorrectly parsed when  nameservers are specified

Status in cloud-init:
  Incomplete
Status in cloud-init package in Suse:
  New

Bug description:
  The issue was reproduced on Azure with cloud-init 19.1 on a SLES12 SP4 
machine. Looking at the code, the same behavior could be reproduced on any 
other configuration where the cloud provider specifies nameservers in the 
network configuration.
  The specified nameservers in network configuration are ignored and cloud-init 
raises an error.
  In network_state.py the function _v2_common builds a name_cmd dictionary 
which is then passed to the function handle_nameserver. The handle_nameserver 
has a decorator that enforces that passed in dictionary to have the key 
"address". But the _v2_common build a dictionary that has the key "addresses" 
instead. That results in raising an error.
  Here's a snapshot of the cloud-init.log

  2019-09-09 16:21:29,479 - network_state.py[DEBUG]: v2(nameserver) -> 
v1(nameserver):
  {'search': 'xkf00b0rtzgejkug4xc2pcinre.xx.internal.cloudapp.net', 'type': 
'nameserver', 'addresses': '168.63.129.16'}
  2019-09-09 16:21:29,479 - network_state.py[WARNING]: Skipping invalid 
command: {'nameservers': {'search': 
'xkf00b0rtzgejkug4xc2pcinre.xx.internal.cloudapp.net', 'addresses': 
'168.63.129.16'}, 'eth0': {'set-name': 'eth0', 'match': {'macaddress': 
u'00:0d:3a:6d:ca:25'}, 'dhcp4': True}}
  Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 321, in parse_config_v2
  self._v2_common(command)
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 697, in _v2_common
  self.handle_nameserver(name_cmd)
File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", 
line 118, in decorator
  required_keys))
  InvalidCommand: Command missing set(['address']) of required keys ['address']

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1843502/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp