예제 #1
0
def load_app_safe(container, container_dir, app_json=STATE_JSON):
    """Load app manifest as object.

    If app manifest is corrupted or invalid, return object with key attributes.
    """
    try:
        return load_app(container_dir, app_json=app_json)
    except ValueError as err:
        _LOGGER.error('Manifest file is corrupted or invalid: %s', err)
        appname = appcfg.app_name(container)
        return utils.to_obj({
            'name': appname,
            'app': appcfg.appname_basename(appname),
            'task': appcfg.appname_task_id(appname),
            'uniqueid': appcfg.app_unique_id(container),
        })
예제 #2
0
 def test_app_unique_id(self):
     """Test returning the unique id from app unique name.
     """
     self.assertEqual(appcfg.app_unique_id('proid.myapp-0-00000000AAAAA'),
                      '00000000AAAAA')