diff --git a/apps/fetch.py b/apps/fetch.py index 5b24c9ab..4168a95f 100755 --- a/apps/fetch.py +++ b/apps/fetch.py @@ -19,7 +19,8 @@ def fetch_target_apps(targets: dict, apps_shortlist: str, token: str, dst_dir: s apps_fetcher = SkopeAppFetcher(token, dst_dir) for target_name, target_json in targets.items(): apps_fetcher.fetch_target(FactoryClient.Target(target_name, target_json), - apps_shortlist, force=True) + [x.strip() for x in apps_shortlist.split(',') if x] + if apps_shortlist else None, force=True) def tar_fetched_apps(src_dir: str, out_file: str): diff --git a/apps/target_apps_fetcher.py b/apps/target_apps_fetcher.py index 9f633c37..9417be83 100644 --- a/apps/target_apps_fetcher.py +++ b/apps/target_apps_fetcher.py @@ -41,12 +41,12 @@ def apps_dir(self, target_name): def images_dir(self, target_name): return os.path.join(self.target_dir(target_name), self.ImagesDir) - def fetch_target(self, target: FactoryClient.Target, shortlist=None, force=False): + def fetch_target(self, target: FactoryClient.Target, shortlist: [str] = None, force=False): self.target_apps.clear() self.fetch_target_apps(target, apps_shortlist=target.shortlist or shortlist, force=force) self.fetch_apps_images(force=force) - def fetch_target_apps(self, target: FactoryClient.Target, apps_shortlist=None, force=False): + def fetch_target_apps(self, target: FactoryClient.Target, apps_shortlist: [str] = None, force=False): self.target_apps[target] = self._fetch_apps(target, apps_shortlist=apps_shortlist, force=force) def fetch_apps_images(self, graphdriver='overlay2', force=False): @@ -71,7 +71,7 @@ def _download_apps_images(apps: ComposeApps, app_images_dir, platform, graphdriv for app in apps: app.download_images(platform, dockerd.host) - def _fetch_apps(self, target, apps_shortlist=None, force=False): + def _fetch_apps(self, target, apps_shortlist: [str] = None, force=False): for app_name, app_uri in target.apps(): if apps_shortlist and app_name not in apps_shortlist: logger.info('{} is not in the shortlist, skipping it'.format(app_name))