Fix: download network templates for 9.1

Change-Id: I145dffa48d932415b19de3c30a60dbcae1b05fbd
This commit is contained in:
Aleksandr Dobdin 2016-12-20 08:38:48 +00:00
parent f00b04a3ed
commit dd688c9d96
3 changed files with 13 additions and 5 deletions

View File

@ -107,6 +107,9 @@ popd
%changelog
* Tue Dec 20 2016 Aleksandr Dobdin <adobdin@mirantis.com> - 1.26.1
- Fix: download network templates for 9.1
* Thu Dec 15 2016 Alexander Lemeshko <oliemieshko@mirantis.com> - 1.26.0
- Add: scripts_all_pairs 'one way' mode

View File

@ -16,7 +16,7 @@
# under the License.
project_name = 'timmy'
version = '1.26.0'
version = '1.26.1'
if __name__ == '__main__':
import sys

View File

@ -4,7 +4,9 @@ exec /usr/bin/env python - << EOF
# -*- coding: utf-8 -*-
from fuelclient.v1.environment import EnvironmentClient
from fuelclient.client import Client as FuelClient
import subprocess
import json
import yaml
class CEnvironmentClient(EnvironmentClient):
def download_network_template(self, environment_id):
@ -13,9 +15,12 @@ class CEnvironmentClient(EnvironmentClient):
return template_data
ec = CEnvironmentClient()
fc = FuelClient()
clusters_dict = fc.get_request('clusters')
p = subprocess.Popen(['fuel', 'env', 'list', '--json'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
clusters_dict = json.loads(out)
for cluster in clusters_dict:
clid=int(cluster['id'])
print('---\n# cluster id:%s\n%s' %(clid, ec.download_network_template(clid)))
print('---\n# cluster id:%s\n%s' %(clid, yaml.dump(yaml.load((json.dumps(ec.download_network_template(clid)))))))
EOF