Added get_openrc to cluster
diff --git a/fuel_rest_api.py b/fuel_rest_api.py
index 4ea511d..ee5cd9c 100644
--- a/fuel_rest_api.py
+++ b/fuel_rest_api.py
@@ -332,7 +332,8 @@
def __init__(self, *dt, **mp):
super(Cluster, self).__init__(*dt, **mp)
- self.nodes = NodeList()
+ self.nodes = NodeList([Node(self.__connection__, **node) for node in
+ self._get_nodes()])
self.network_roles = {}
def check_exists(self):
@@ -345,12 +346,18 @@
return False
raise
- def get_creds(self):
+ def get_openrc(self):
access = self.get_attributes()['editable']['access']
creds = {}
creds['username'] = access['user']['value']
creds['password'] = access['password']['value']
creds['tenant_name'] = access['tenant']['value']
+ if self.nodes.controller:
+ contr = self.nodes.controller[0]
+ creds['os_auth_url'] = "http://%s:5000/v2.0" \
+ % contr.get_ip(network="public")
+ else:
+ creds['os_auth_url'] = ""
return creds
def get_nodes(self):