Explorar o código

Skip GCP resources with {+param} placeholders

The compute v1 discovery doc added resources (reservationSlots,
reservationSubBlocks) whose paths use gRPC reserved-character
placeholders like {+parentName}, which string.Template cannot
substitute. Skip these in GCPResources since cloudbridge does not
address them anyway; previously the constructor crashed on init,
breaking every GCP operation.
Nuwan Goonasekera hai 2 días
pai
achega
e423798e0a
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      cloudbridge/providers/gcp/provider.py

+ 6 - 0
cloudbridge/providers/gcp/provider.py

@@ -126,6 +126,12 @@ class GCPResources(object):
             method = methods['get']
             parameters = method['parameterOrder']
 
+            # Skip resources using gRPC reserved-character placeholders
+            # ({+param}); string.Template can't handle them and cloudbridge
+            # does not address these resources.
+            if '{+' in method['path']:
+                continue
+
             # We would like to change a path like
             # {project}/regions/{region}/addresses/{address} to a pattern like
             # (PROJECT REGEX)/regions/(REGION REGEX)/addresses/(ADDRESS REGEX).