Added logger.debug lines to remaining functions, useful for debugging
[osm/osmclient.git] / osmclient / sol005 / osmrepo.py
index c2bb0c9..efd2207 100644 (file)
@@ -150,6 +150,7 @@ class OSMRepo(Repo):
             :param origin: origin directory for getting all the artifacts
             :param destination: destination folder for create and index the valid artifacts
         """
+        self._logger.debug("")
         if destination == '.':
             if origin == destination:
                 destination = 'repository'
@@ -179,6 +180,7 @@ class OSMRepo(Repo):
             :param fname: file path
             :return: checksum string
         """
+        self._logger.debug("")
         hash_md5 = hashlib.md5()
         with open(fname, "rb") as f:
             for chunk in iter(lambda: f.read(4096), b""):
@@ -193,6 +195,7 @@ class OSMRepo(Repo):
             :param package_type: type of artifact (vnf or ns)
             :return: fields
         """
+        self._logger.debug("")
         fields = {}
         base_path = '/{}/'.format(package_type)
         aux_dict = {}
@@ -252,6 +255,7 @@ class OSMRepo(Repo):
             :param path: file path
             :return: status details, status, fields, package_type
         """
+        self._logger.debug("")
         package_type = ''
         folder = ''
         try:
@@ -291,6 +295,7 @@ class OSMRepo(Repo):
             file: VNF or NS
             destination: path for index creation
         """
+        self._logger.debug("")
         pt = PackageTool()
         compresed = False
         try:
@@ -320,6 +325,7 @@ class OSMRepo(Repo):
             :param package_type: package type (vnf, ns)
             :param fields: dict with the required values
         """
+        self._logger.debug("")
         data_ind = {'name': fields.get('name'), 'description': fields.get('description'),
                     'vendor': fields.get('vendor'), 'path': fields.get('path')}
 
@@ -360,6 +366,7 @@ class OSMRepo(Repo):
             Datetime Generator
             :return: Datetime as string with the following structure "2020-04-29T08:41:07.681653Z"
         """
+        self._logger.debug("")
         return time.strftime('%Y-%m-%dT%H:%M:%S.%sZ')
 
     def init_directory(self, destination):
@@ -368,6 +375,7 @@ class OSMRepo(Repo):
             :param destination:
             :return:
         """
+        self._logger.debug("")
         if not isdir(destination):
             mkdir(destination)
         if not isfile(join(destination, 'index.yaml')):
@@ -377,3 +385,4 @@ class OSMRepo(Repo):
                           'ns_packages': {}}
             with open(join(destination, 'index.yaml'), 'w') as outfile:
                 ruamel.yaml.dump(index_data, outfile, default_flow_style=False)
+