Fix: download network templates for 9.1
Change-Id: I145dffa48d932415b19de3c30a60dbcae1b05fbd
This commit is contained in:
parent
f00b04a3ed
commit
dd688c9d96
@ -107,6 +107,9 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Thu Dec 15 2016 Alexander Lemeshko <oliemieshko@mirantis.com> - 1.26.0
|
||||||
- Add: scripts_all_pairs 'one way' mode
|
- Add: scripts_all_pairs 'one way' mode
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
project_name = 'timmy'
|
project_name = 'timmy'
|
||||||
version = '1.26.0'
|
version = '1.26.1'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
|
@ -4,7 +4,9 @@ exec /usr/bin/env python - << EOF
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from fuelclient.v1.environment import EnvironmentClient
|
from fuelclient.v1.environment import EnvironmentClient
|
||||||
from fuelclient.client import Client as FuelClient
|
import subprocess
|
||||||
|
import json
|
||||||
|
import yaml
|
||||||
|
|
||||||
class CEnvironmentClient(EnvironmentClient):
|
class CEnvironmentClient(EnvironmentClient):
|
||||||
def download_network_template(self, environment_id):
|
def download_network_template(self, environment_id):
|
||||||
@ -13,9 +15,12 @@ class CEnvironmentClient(EnvironmentClient):
|
|||||||
return template_data
|
return template_data
|
||||||
|
|
||||||
ec = CEnvironmentClient()
|
ec = CEnvironmentClient()
|
||||||
fc = FuelClient()
|
p = subprocess.Popen(['fuel', 'env', 'list', '--json'],
|
||||||
clusters_dict = fc.get_request('clusters')
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE)
|
||||||
|
out, err = p.communicate()
|
||||||
|
clusters_dict = json.loads(out)
|
||||||
for cluster in clusters_dict:
|
for cluster in clusters_dict:
|
||||||
clid=int(cluster['id'])
|
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
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user