+
+ def rspec_versions(self):
+ version_manager = VersionManager()
+ ad_rspec_versions = []
+ request_rspec_versions = []
+ for rspec_version in version_manager.versions:
+ # avoid publishing non-relevant entries
+ # but stay safe however
+ try:
+ if not rspec_version.extensions \
+ and not rspec_version.namespace \
+ and not rspec_version.schema:
+ continue
+ except Exception as exc:
+ pass
+ if rspec_version.content_type in ['*', 'ad']:
+ ad_rspec_versions.append(rspec_version.to_dict())
+ if rspec_version.content_type in ['*', 'request']:
+ request_rspec_versions.append(rspec_version.to_dict())
+ return {
+ 'geni_request_rspec_versions': request_rspec_versions,
+ 'geni_ad_rspec_versions': ad_rspec_versions,
+ }
+
+ def get_rspec_version_string(self, rspec_version, options=None):
+ if options is None:
+ options = {}
+ version_string = "rspec_%s" % (rspec_version)
+
+ # panos adding the info option to the caching key (can be improved)
+ if options.get('info'):
+ version_string = version_string + \
+ "_" + options.get('info', 'default')
+
+ # Adding the list_leases option to the caching key
+ if options.get('list_leases'):
+ version_string = version_string + "_" + \
+ options.get('list_leases', 'default')
+
+ # Adding geni_available to caching key
+ if options.get('geni_available'):
+ version_string = version_string + "_" + \
+ str(options.get('geni_available'))
+
+ return version_string
+