コード例 #1
0
ファイル: api.py プロジェクト: openvstorage/alba-asdmanager
 def get_package_information_new():
     """
     Retrieve update information
     This call is used by the new framework code (as off 30 Nov 2016)
     In case framework has new code, but SDM runs old code, the asdmanager.py plugin will adjust the old format to the new format
     """
     with file_mutex('package_update'):
         API._logger.info('Locking in place for package update')
         return SDMUpdateController.get_package_information()
コード例 #2
0
 def get_package_information_new():
     # type: () -> dict
     """
     Retrieve update information
     This call is used by the new framework code (as off 30 Nov 2016)
     In case framework has new code, but SDM runs old code, the asdmanager.py plugin will adjust the old format to the new format
     :return: Installed and candidate for install version for all SDM related packages
     :rtype: dict
     """
     with file_mutex('package_update'):
         API._logger.info('Locking in place for package update')
         return SDMUpdateController.get_package_information()
コード例 #3
0
ファイル: api.py プロジェクト: openvstorage/alba-asdmanager
 def get_package_information_old():
     """
     Retrieve update information
     This call is required when framework has old code and SDM has been updated (as off 30 Nov 2016)
     Old code tries to call /update/information and expects data formatted in the old style
     """
     return_value = {'version': '', 'installed': ''}
     with file_mutex('package_update'):
         API._logger.info('Locking in place for package update')
         update_info = SDMUpdateController.get_package_information().get('alba', {})
         if 'openvstorage-sdm' in update_info:
             return_value['version'] = update_info['openvstorage-sdm']['candidate']
             return_value['installed'] = update_info['openvstorage-sdm']['installed']
         elif 'alba' in update_info:
             return_value['version'] = update_info['alba']['candidate']
             return_value['installed'] = update_info['alba']['installed']
     return return_value
コード例 #4
0
 def get_package_information_old():
     # type: () -> dict
     """
     Retrieve update information
     This call is required when framework has old code and SDM has been updated (as off 30 Nov 2016)
     Old code tries to call /update/information and expects data formatted in the old style
     :return: Installed and candidate for install version for all SDM related packages
     :rtype: dict
     """
     return_value = {'version': '', 'installed': ''}
     with file_mutex('package_update'):
         API._logger.info('Locking in place for package update')
         update_info = SDMUpdateController.get_package_information().get(
             'alba', {})
         if 'openvstorage-sdm' in update_info:
             return_value['version'] = update_info['openvstorage-sdm'][
                 'candidate']
             return_value['installed'] = update_info['openvstorage-sdm'][
                 'installed']
         elif 'alba' in update_info:
             return_value['version'] = update_info['alba']['candidate']
             return_value['installed'] = update_info['alba']['installed']
     return return_value