From: Thierry Parmentelat Date: Fri, 16 Dec 2011 16:39:32 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.onelab.eu/git/sfa X-Git-Tag: sfa-2.0-7~16 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=e67041c37b86490c71d2f0b4d4b9c27b283141de Merge branch 'master' of ssh://git.onelab.eu/git/sfa Conflicts: sfa/client/sfi.py --- e67041c37b86490c71d2f0b4d4b9c27b283141de diff --cc sfa/client/sfi.py index 5f7aefe5,8d9f37e0..73d00997 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@@ -815,44 -815,28 +815,30 @@@ or with an slice hrn, shows currently p creds.append(self.my_credential_string) if options.delegate: creds.append(self.delegate_cred(cred, get_authority(self.authority))) - - # V2 API - if self.server_supports_options_arg(server): - # with v2 everything goes in options inclusing the subject slice - api_options = {} - if args: - hrn = args[0] - api_options['geni_slice_urn'] = hrn_to_urn(hrn, 'slice') - if options.info: - api_options['info'] = options.info - if options.rspec_version: - version_manager = VersionManager() - server_version = self.get_cached_server_version(server) - if 'sfa' in server_version: - # just request the version the client wants - api_options['geni_rspec_version'] = version_manager.get_version(options.rspec_version).to_dict() - else: - # this must be a protogeni aggregate. We should request a v2 ad rspec - # regardless of what the client user requested - api_options['geni_rspec_version'] = version_manager.get_version('ProtoGENI 2').to_dict() + + # no need to check if server accepts the options argument since the options has + # been a required argument since v1 API + api_options = {} + # always send call_id to v2 servers + api_options ['call_id'] = unique_call_id() ++ # ask for cached value if available ++ api_options ['cached'] = True + if args: + hrn = args[0] + api_options['geni_slice_urn'] = hrn_to_urn(hrn, 'slice') + if options.info: + api_options['info'] = options.info + if options.rspec_version: + version_manager = VersionManager() + server_version = self.get_cached_server_version(server) + if 'sfa' in server_version: + # just request the version the client wants + api_options['geni_rspec_version'] = version_manager.get_version(options.rspec_version).to_dict() else: api_options['geni_rspec_version'] = {'type': 'geni', 'version': '3.0'} - # always send call_id to v2 servers - api_options ['call_id'] = unique_call_id() - # ask for cached value if available - api_options ['cached'] = True - # the V2 form - result = server.ListResources (creds, api_options) - # V1 else: - # with an argument - if args: - hrn = args[0] - # xxx looks like we can pass a hrn and not a urn here ?? - # last arg. is a raw call_id when supported - result = server.ListResources (creds, hrn, *self.cis(server)) - else: - result = server.ListResources (creds, *self.cis(server)) + api_options['geni_rspec_version'] = {'type': 'geni', 'version': '3.0'} + result = server.ListResources (creds, api_options) value = ReturnValue.get_value(result) if options.file is None: display_rspec(value, options.format)