File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 30
30
31
31
_LOGGER = logging .getLogger (__name__ )
32
32
_ARMID_RE = re .compile (
33
- "(?i)/subscriptions/(?P<subscription>[^/]* )(/resourceGroups/(?P<resource_group>[^/]* ))?"
34
- "(/providers/(?P<namespace>[^/]* )/(?P<type>[^/]*)/(?P<name>[^/]* )(?P<children>.*))?"
33
+ "(?i)/subscriptions/(?P<subscription>[^/]+ )(/resourceGroups/(?P<resource_group>[^/]+ ))?"
34
+ "(/providers/(?P<namespace>[^/]+ )/(?P<type>[^/]*)/(?P<name>[^/]+ )(?P<children>.*))?"
35
35
)
36
36
37
37
_CHILDREN_RE = re .compile (
38
- "(?i)(/providers/(?P<child_namespace>[^/]* ))?/"
39
- "(?P<child_type>[^/]*)/(?P<child_name>[^/]* )"
38
+ "(?i)(/providers/(?P<child_namespace>[^/]+ ))?/"
39
+ "(?P<child_type>[^/]*)/(?P<child_name>[^/]+ )"
40
40
)
41
41
42
42
_ARMNAME_RE = re .compile ("^[^<>%&:\\ ?/]{1,260}$" )
Original file line number Diff line number Diff line change @@ -239,7 +239,9 @@ def test_resource_parse(self):
239
239
invalid_ids = [
240
240
'/subscriptions/fakesub/resourceGroups/myRg/type1/name1' ,
241
241
'/subscriptions/fakesub/resourceGroups/myRg/providers/Microsoft.Provider/foo' ,
242
- '/subscriptions/fakesub/resourceGroups/myRg/providers/namespace/type/name/type1'
242
+ '/subscriptions/fakesub/resourceGroups/myRg/providers/namespace/type/name/type1' ,
243
+ '/subscriptions/fakesub/resourceGroups/' ,
244
+ '/subscriptions//resourceGroups/'
243
245
]
244
246
for invalid_id in invalid_ids :
245
247
self .assertFalse (is_valid_resource_id (invalid_id ))
You can’t perform that action at this time.
0 commit comments