Autodeploy inspired on Prototype #2
[genesis.git] / fuel / deploy / cloud / configure_network.py
similarity index 77%
rename from fuel/deploy/cloud_deploy/cloud/configure_network.py
rename to fuel/deploy/cloud/configure_network.py
index f4d6f87..295eb90 100644 (file)
@@ -10,7 +10,7 @@ exec_cmd = common.exec_cmd
 parse = common.parse
 err = common.err
 check_file_exists = common.check_file_exists
-LOG = common.LOG
+log = common.log
 
 class ConfigureNetwork(object):
 
@@ -21,29 +21,28 @@ class ConfigureNetwork(object):
         self.required_networks = []
 
     def download_network_config(self):
-        LOG.debug('Download network config for environment %s\n' % self.env_id)
+        log('Download network config for environment %s' % self.env_id)
         exec_cmd('fuel network --env %s --download --dir %s'
                  % (self.env_id, self.yaml_config_dir))
 
     def upload_network_config(self):
-        LOG.debug('Upload network config for environment %s\n' % self.env_id)
+        log('Upload network config for environment %s' % self.env_id)
         exec_cmd('fuel network --env %s --upload --dir %s'
                  % (self.env_id, self.yaml_config_dir))
 
     def config_network(self):
-        LOG.debug('Configure network\n')
+        log('Configure network')
         self.download_network_config()
         self.modify_network_config()
         self.upload_network_config()
 
     def modify_network_config(self):
-        LOG.debug('Modify network config for environment %s\n' % self.env_id)
-        network_yaml = (self.yaml_config_dir + '/network_%s.yaml'
-                        % self.env_id)
+        log('Modify network config for environment %s' % self.env_id)
+        network_yaml = ('%s/network_%s.yaml'
+                        % (self.yaml_config_dir, self.env_id))
         check_file_exists(network_yaml)
 
-        network_config = self.dea.get_networks()
-
+        network_config = self.dea.get_property('network')
 
         with io.open(network_yaml) as stream:
             network = yaml.load(stream)