Fixed issues with review comments.
This commit is contained in:
parent
69d2e897d2
commit
fc16de8023
|
@ -28,6 +28,7 @@ import cinderclient.client
|
|||
import glanceclient.client
|
||||
import keystoneclient.v2_0.client
|
||||
import novaclient.client
|
||||
import muranoclient.v1.client
|
||||
|
||||
|
||||
from fuel_health import exceptions
|
||||
|
@ -136,6 +137,14 @@ class CleanUpClientManager(fuel_health.manager.Manager):
|
|||
auth_url=auth_url,
|
||||
insecure=dscv)
|
||||
|
||||
def _get_murano_client()
|
||||
token_id = self.manager._get_identity_client().auth_token
|
||||
api_host = self.config.murano.api_url
|
||||
insecure = self.config.murano.insecure
|
||||
|
||||
return muranoclient.v1.client.Client(endpoint=api_host, token=token_id,
|
||||
insecure=insecure)
|
||||
|
||||
def wait_for_server_termination(self, server, ignore_error=False):
|
||||
"""Waits for server to reach termination."""
|
||||
start_time = int(time.time())
|
||||
|
@ -288,6 +297,15 @@ def cleanup():
|
|||
LOG.debug(exc)
|
||||
pass
|
||||
|
||||
environments = manager._get_murano_client().environments.list()
|
||||
for environment in environments:
|
||||
if environment['name'].startswith('ost1_test-'):
|
||||
try:
|
||||
LOG.info('start environment deletion')
|
||||
manager._get_murano_client().environments.delete(environment['id'])
|
||||
except Exception as exc:
|
||||
LOG.debug(exc)
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
cleanup()
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from muranoclient.v1.client import Client
|
||||
import muranoclient.v1.client
|
||||
import nmanager
|
||||
|
||||
|
||||
|
@ -72,9 +72,9 @@ class MuranoTest(nmanager.OfficialClientTest):
|
|||
"""
|
||||
This method returns Murano API client
|
||||
"""
|
||||
return Client(endpoint=self.api_host,
|
||||
token=self.token_id,
|
||||
insecure=self.insecure)
|
||||
return muranoclient.v1.client.Client(endpoint=self.api_host,
|
||||
token=self.token_id,
|
||||
insecure=self.insecure)
|
||||
|
||||
def verify_elements_list(self, elements, attrs, msg='', failed_step=''):
|
||||
"""
|
||||
|
@ -88,7 +88,7 @@ class MuranoTest(nmanager.OfficialClientTest):
|
|||
if failed_step:
|
||||
msg = ('Step %s failed: ' % str(failed_step)) + msg
|
||||
|
||||
if len(elements) == 0:
|
||||
if not elements:
|
||||
self.fail(msg)
|
||||
|
||||
for element in elements:
|
||||
|
@ -246,9 +246,9 @@ class MuranoTest(nmanager.OfficialClientTest):
|
|||
Returns specific service.
|
||||
"""
|
||||
|
||||
url = '/' + str(service_id)
|
||||
|
||||
return self.murano_client.services.get(environment_id, url, session_id)
|
||||
return self.murano_client.services.get(environment_id,
|
||||
'/{0}'.format(service_id),
|
||||
session_id)
|
||||
|
||||
def delete_service(self, environment_id, session_id, service_id):
|
||||
"""
|
||||
|
@ -262,7 +262,6 @@ class MuranoTest(nmanager.OfficialClientTest):
|
|||
Returns None.
|
||||
"""
|
||||
|
||||
url = '/' + str(service_id)
|
||||
|
||||
return self.murano_client.services.delete(environment_id, url,
|
||||
return self.murano_client.services.delete(environment_id,
|
||||
'/{0}'.format(service_id),
|
||||
session_id)
|
||||
|
|
|
@ -33,7 +33,7 @@ class ServicesTestJSON(murano.MuranoTest):
|
|||
Duration: 5 s.
|
||||
"""
|
||||
|
||||
fail_msg = 'User can not get list of environments.'
|
||||
fail_msg = 'Environments list is unavailable.'
|
||||
environments = self.verify(5, self.list_environments,
|
||||
2, fail_msg, "environments listing")
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ python-keystoneclient==0.3.1
|
|||
python-mimeparse==0.1.4
|
||||
python-novaclient==2.13.0
|
||||
python-neutronclient>=2.2
|
||||
python-muranoclient
|
||||
python-muranoclient>=0.2
|
||||
requests==1.2.3
|
||||
setuptools-git==1.0
|
||||
simplejson==3.3.0
|
||||
|
|
Loading…
Reference in New Issue