New Question

fke's profile - activity

2017-08-18 01:20:34 +0200 received badge  Student (source)
2014-11-27 16:05:06 +0200 received badge  Famous Question (source)
2014-10-06 02:10:40 +0200 received badge  Notable Question (source)
2014-10-01 23:22:15 +0200 received badge  Popular Question (source)
2014-10-01 10:26:57 +0200 commented answer SOLVED - static networking configuration with cloudbase-init fails

Hi avladu, thanks for your help. Please see my own answer, I am not allowed to post it as comment to your answer (too many characters) Thanks, Florian

2014-10-01 10:25:06 +0200 answered a question SOLVED - static networking configuration with cloudbase-init fails

UPDATE / solved

Hi avladu,

thanks. You putted me in the right direction! I was missing "s" at the end of dns-nameserver. So this is info is evaluated properly:

cat << EOF > ./seed/openstack/content/network
iface eth0 inet static
  address 192.168.1.90
  netmask 255.255.255.0
  broadcast 192.168.1.255
  gateway 192.168.1.254
  dns-nameservers 8.8.8.8

EOF

Bye, Florian

old anwer

Hi avladu,

thanks for your help. I did as advised. Still the same error. Even worse, I can't get it to work even completely isolated:

$ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> debian_network_conf="""
... iface eth0 inet static
...   address 192.168.1.90
...   netmask 255.255.255.0
...   broadcast 192.168.1.255
...   gateway 192.168.1.254
...   dns-nameserver 8.8.8.8
... 
... """
>>> m = re.search(r'iface eth0 inet static\s+'                                   
...               r'address\s+(?P<address>[^\s]+)\s+'                            
...               r'netmask\s+(?P<netmask>[^\s]+)\s+'                            
...               r'broadcast\s+(?P<broadcast>[^\s]+)\s+'                        
...               r'gateway\s+(?P<gateway>[^\s]+)\s+'                            
...               r'dns\-nameservers\s+(?P<dnsnameservers>[^\r\n]+)\s+',         
...               debian_network_conf)
>>> 
>>>

whereas, without concatenating the regexp I can get matches

>>> re.search(r'iface eth0 inet static\s+',debian_network_conf)  
<_sre.SRE_Match object at 0x10ce798b8>
>>> re.search(r'address\s+(?P<address>[^\s]+)\s+',debian_network_conf)                            
<_sre.SRE_Match object at 0x10ce78990>

So, what am I doing wrong?

Thanks in advance, Florian

2014-09-30 17:43:01 +0200 received badge  Editor (source)
2014-09-30 17:42:16 +0200 received badge  Organizer (source)
2014-09-30 17:37:29 +0200 asked a question SOLVED - static networking configuration with cloudbase-init fails

Ciao Alex,

grazie mille per il tuo lavoro!

static network conf with cloudbase-init fails for me, the logs shows "network_config format not recognized".

I'm providing a config via a selfmade configV2 drive and I wonder in which format I am supposed to provide debian_network_conf (cloudbaseinit/plugins/windows/networkconfig.py)

right now it's a multiline string:

iface eth0 inet static
  address 192.168.1.90
  broadcast 192.168.1.255
  netmask 255.255.255.0
  gateway 192.168.1.254
  dns-nameserver 8.8.8.8

Put otherwise: How is this supposed to work? Did it ever?

# TODO (alexpilotti): implement a proper grammar                             
m = re.search(r'iface eth0 inet static\s+'                                   
              r'address\s+(?P<address>[^\s]+)\s+'                            
              r'netmask\s+(?P<netmask>[^\s]+)\s+'                            
              r'broadcast\s+(?P<broadcast>[^\s]+)\s+'                        
              r'gateway\s+(?P<gateway>[^\s]+)\s+'                            
              r'dns\-nameservers\s+(?P<dnsnameservers>[^\r\n]+)\s+',         
              debian_network_conf)

Grazie mille ancora! Florian