X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=blobdiff_plain;f=osmclient%2Fcommon%2Futils.py;h=6b6c6f9717fe0d6d146acfad8ac4a03b20da2db6;hp=8ef325fbf570f7f663ba9bc93092193ea70d57a0;hb=a63fb3c6887ecf8221e868e0c8d39d51319ea085;hpb=4cf06fb2ad8d7865227ef9600a11795cbc41d641 diff --git a/osmclient/common/utils.py b/osmclient/common/utils.py index 8ef325f..6b6c6f9 100644 --- a/osmclient/common/utils.py +++ b/osmclient/common/utils.py @@ -21,6 +21,7 @@ import tarfile import re import yaml + def wait_for_value(func, result=True, wait_time=10, catch_exception=None): maxtime = time.time() + wait_time while time.time() < maxtime: @@ -53,13 +54,13 @@ def md5(fname): def get_key_val_from_pkg(descriptor_file): -# method opens up a package and finds the name of the resulting -# descriptor (vnfd or nsd name) + # method opens up a package and finds the name of the resulting + # descriptor (vnfd or nsd name) tar = tarfile.open(descriptor_file) yamlfile = None for member in tar.getmembers(): if (re.match('.*.yaml', member.name) and - len(member.name.split('/')) == 2): + len(member.name.split('/')) == 2): yamlfile = member.name break if yamlfile is None: @@ -87,4 +88,3 @@ def get_key_val_from_pkg(descriptor_file): result[key_name] = v3 tar.close() return result -