diff --git a/azure_batch_maya/scripts/pools.py b/azure_batch_maya/scripts/pools.py index a883f13..d7b321f 100644 --- a/azure_batch_maya/scripts/pools.py +++ b/azure_batch_maya/scripts/pools.py @@ -52,7 +52,7 @@ class AzureBatchPools(object): self.batch = self._session.batch self.environment = env - def list_pools(self, lazy=False): + def list_pools(self, lazy=False, requiredAppLicenses=None): """Retrieves the currently running pools. Is called on loading and refreshing the pools tab, also when populating the job submission pool selection drop down menu. @@ -63,6 +63,9 @@ class AzureBatchPools(object): self.pools = [] for pool in all_pools: if pool.virtual_machine_configuration: + if requiredAppLicenses: + if not set(requiredAppLicenses).issubset(pool.application_licenses): + continue self.pools.append(pool) self.pools.sort(key=lambda x: x.creation_time, reverse=True) self.count = len(self.pools) diff --git a/azure_batch_maya/scripts/submission.py b/azure_batch_maya/scripts/submission.py index a7bfb01..03971ad 100644 --- a/azure_batch_maya/scripts/submission.py +++ b/azure_batch_maya/scripts/submission.py @@ -230,7 +230,9 @@ class AzureBatchSubmission(object): """Retrieve the currently available pools to populate the job submission pool selection drop down. """ - pools = self.pool_manager.list_pools(lazy=True) + self.env_manager._get_plugin_licenses() + required_app_licenses = self.env_manager.get_application_licenses() + pools = self.pool_manager.list_pools(lazy=True, requiredAppLicenses=required_app_licenses) return pools def submit(self, watch_job=False, download_dir=None):