diff --git a/astakosclient/astakosclient/services.py b/astakosclient/astakosclient/services.py index 649b1408d39ae002a72e9928c4c76e8f89596356..8e9f2a8d9e95caeaf35beebed4683ef091129137 100644 --- a/astakosclient/astakosclient/services.py +++ b/astakosclient/astakosclient/services.py @@ -59,7 +59,7 @@ astakos_services = { 'prefix': 'ui', 'public': False, 'endpoints': [ - {'versionId': 'v1.0', + {'versionId': '', 'publicURL': None}, ]}, } diff --git a/snf-astakos-app/astakos/im/management/commands/service-export-astakos.py b/snf-astakos-app/astakos/im/management/commands/service-export-astakos.py index 6e6d1c958c1f10a7550987e4a0a4a4db5caf4958..96cb2ce2dd5a997bfee2fa3cb208888ec0f15da6 100644 --- a/snf-astakos-app/astakos/im/management/commands/service-export-astakos.py +++ b/snf-astakos-app/astakos/im/management/commands/service-export-astakos.py @@ -35,11 +35,12 @@ from django.utils import simplejson as json from django.core.management.base import NoArgsCommand # import from settings, after any post-processing from astakos.im.settings import astakos_services +from synnefo.lib.services import filter_public class Command(NoArgsCommand): help = "Export Astakos services in JSON format." def handle(self, *args, **options): - output = json.dumps(astakos_services, indent=4) + output = json.dumps(filter_public(astakos_services), indent=4) self.stdout.write(output + "\n") diff --git a/snf-common/synnefo/lib/services.py b/snf-common/synnefo/lib/services.py index 11adcbb342122e130536a4347bdd0b89f478a601..04d0822077efbd7fc465185de64fbbc1ec68d507 100644 --- a/snf-common/synnefo/lib/services.py +++ b/snf-common/synnefo/lib/services.py @@ -31,6 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. +from copy import deepcopy from synnefo.lib import join_urls from synnefo.util.keypath import get_path, set_path @@ -47,3 +48,11 @@ def fill_endpoints(services, base_url): publicURL = join_urls(base_url, prefix, version) set_path(endpoint, 'publicURL', publicURL) + + +def filter_public(services): + public_services = {} + for name, service in services.iteritems(): + if service.get('public', False): + public_services[name] = deepcopy(service) + return public_services diff --git a/snf-cyclades-app/synnefo/api/management/commands/service-export-cyclades.py b/snf-cyclades-app/synnefo/api/management/commands/service-export-cyclades.py index 6c38454d96c62226d74baf19936d6c6ffb6ce923..146f1891c25311b7f98e35a0f11cc4b72e574b94 100644 --- a/snf-cyclades-app/synnefo/api/management/commands/service-export-cyclades.py +++ b/snf-cyclades-app/synnefo/api/management/commands/service-export-cyclades.py @@ -34,11 +34,12 @@ from django.utils import simplejson as json from django.core.management.base import NoArgsCommand from synnefo.cyclades_settings import cyclades_services +from synnefo.lib.services import filter_public class Command(NoArgsCommand): help = "Export Cyclades services in JSON format." def handle(self, *args, **options): - output = json.dumps(cyclades_services, indent=4) + output = json.dumps(filter_public(cyclades_services), indent=4) self.stdout.write(output + "\n") diff --git a/snf-pithos-app/pithos/api/management/commands/service-export-pithos.py b/snf-pithos-app/pithos/api/management/commands/service-export-pithos.py index f931d360d3625677563a61e92b6bc749a98a4f93..3028bf4430bacba7f990a95b64adffe7a2e0c71b 100644 --- a/snf-pithos-app/pithos/api/management/commands/service-export-pithos.py +++ b/snf-pithos-app/pithos/api/management/commands/service-export-pithos.py @@ -34,11 +34,12 @@ from django.utils import simplejson as json from django.core.management.base import NoArgsCommand from pithos.api.settings import pithos_services +from synnefo.lib.services import filter_public class Command(NoArgsCommand): help = "Export Pithos services in JSON format." def handle(self, *args, **options): - output = json.dumps(pithos_services, indent=4) + output = json.dumps(filter_public(pithos_services), indent=4) self.stdout.write(output + "\n") diff --git a/snf-pithos-app/pithos/api/services.py b/snf-pithos-app/pithos/api/services.py index ff09fede1177e367ddf14669626caa55370aa1a1..38654711315d91591614db2c9a9691dcf57e39bc 100644 --- a/snf-pithos-app/pithos/api/services.py +++ b/snf-pithos-app/pithos/api/services.py @@ -57,7 +57,7 @@ pithos_services = { 'type': 'pithos_ui', 'component': 'pithos', 'prefix': 'ui', - 'public': True, + 'public': False, 'endpoints': [ {'versionId': '', 'publicURL': None},