diff options
| author | Scott Moser <smoser@ubuntu.com> | 2013-09-27 19:38:05 -0400 | 
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2013-09-27 19:38:05 -0400 | 
| commit | cafa32eb35e6ef7eba70a49e56dfeda51fd1f8a1 (patch) | |
| tree | 25596b8dc52d4e355805dfdff2032763e57d73cc /cloudinit/sources/DataSourceSmartOS.py | |
| parent | 4063358ec2f20bcff4328fb659cecbed668a9a48 (diff) | |
| parent | fdf5a48420b670b4b07c745b2b80c1cb23f253db (diff) | |
| download | vyos-cloud-init-cafa32eb35e6ef7eba70a49e56dfeda51fd1f8a1.tar.gz vyos-cloud-init-cafa32eb35e6ef7eba70a49e56dfeda51fd1f8a1.zip  | |
Enable filesystem creation on Azure, many disk_setup cleanups
There are a lot of cleanups here around Azure, SmartOS and disk_setup.
disk_setup correctly identifies disk "aliases" (block device mappings
from ec2), anywhere where you would use a device name.
You can also specify these mappings to the Azure or SmartOS datasource
in their datasource config (device_aliases).
Also, stop Azure from calling blkid repeatedly in its tests, which
really pounded my laptop.
Diffstat (limited to 'cloudinit/sources/DataSourceSmartOS.py')
| -rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index da1eec79..93b8b50b 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -72,14 +72,17 @@ BUILTIN_DS_CONFIG = {                           'iptables_disable'],      'base64_keys': [],      'base64_all': False, -    'ephemeral_disk': '/dev/vdb', +    'disk_aliases': {'ephemeral0': '/dev/vdb'}, +} + +BUILTIN_CLOUD_CONFIG = {      'disk_setup': {          'ephemeral0': {'table_type': 'mbr', -                       'layout': True, +                       'layout': False,                         'overwrite': False}           },      'fs_setup': [{'label': 'ephemeral0', 'filesystem': 'ext3', -                  'device': '/dev/xvdb', 'partition': 'auto'}], +                  'device': 'ephemeral0', 'partition': 'auto'}],  } @@ -94,9 +97,7 @@ class DataSourceSmartOS(sources.DataSource):              BUILTIN_DS_CONFIG])          self.metadata = {} -        self.cfg = {} -        self.cfg['disk_setup'] = self.ds_cfg.get('disk_setup') -        self.cfg['fs_setup'] = self.ds_cfg.get('fs_setup') +        self.cfg = BUILTIN_CLOUD_CONFIG          self.seed = self.ds_cfg.get("serial_device")          self.seed_timeout = self.ds_cfg.get("serial_timeout") @@ -154,8 +155,7 @@ class DataSourceSmartOS(sources.DataSource):          return True      def device_name_to_device(self, name): -        if 'ephemeral0' in name: -            return self.ds_cfg['ephemeral_disk'] +        return self.ds_cfg['disk_aliases'].get(name)      def get_config_obj(self):          return self.cfg  | 
