~ubuntu-branches/ubuntu/saucy/cloud-init/saucy

« back to all changes in this revision

Viewing changes to cloudinit/sources/DataSourceSmartOS.py

  • Committer: Scott Moser
  • Date: 2013-09-27 23:47:33 UTC
  • mfrom: (1.4.7)
  • Revision ID: smoser@ubuntu.com-20130927234733-d6g4ngz3lyfclq9a
* New upstream snapshot.
  * fixes to disk_setup config module and enabling of partition
    creation and filesystem creation on Azure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
                         'iptables_disable'],
73
73
    'base64_keys': [],
74
74
    'base64_all': False,
75
 
    'ephemeral_disk': '/dev/vdb',
 
75
    'disk_aliases': {'ephemeral0': '/dev/vdb'},
 
76
}
 
77
 
 
78
BUILTIN_CLOUD_CONFIG = {
76
79
    'disk_setup': {
77
80
        'ephemeral0': {'table_type': 'mbr',
78
 
                       'layout': True,
 
81
                       'layout': False,
79
82
                       'overwrite': False}
80
83
         },
81
84
    'fs_setup': [{'label': 'ephemeral0', 'filesystem': 'ext3',
82
 
                  'device': '/dev/xvdb', 'partition': 'auto'}],
 
85
                  'device': 'ephemeral0', 'partition': 'auto'}],
83
86
}
84
87
 
85
88
 
94
97
            BUILTIN_DS_CONFIG])
95
98
 
96
99
        self.metadata = {}
97
 
        self.cfg = {}
98
 
        self.cfg['disk_setup'] = self.ds_cfg.get('disk_setup')
99
 
        self.cfg['fs_setup'] = self.ds_cfg.get('fs_setup')
 
100
        self.cfg = BUILTIN_CLOUD_CONFIG
100
101
 
101
102
        self.seed = self.ds_cfg.get("serial_device")
102
103
        self.seed_timeout = self.ds_cfg.get("serial_timeout")
154
155
        return True
155
156
 
156
157
    def device_name_to_device(self, name):
157
 
        if 'ephemeral0' in name:
158
 
            return self.ds_cfg['ephemeral_disk']
 
158
        return self.ds_cfg['disk_aliases'].get(name)
159
159
 
160
160
    def get_config_obj(self):
161
161
        return self.cfg