Skip to content

Commit 207afab

Browse files
committed
fix manila mapping, regex
1 parent 71037b4 commit 207afab

File tree

3 files changed

+84
-75
lines changed

3 files changed

+84
-75
lines changed

etc/manila.yaml

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,87 @@
11
custom_actions:
2-
tenant:
3-
extensions:
4-
- method: GET
5-
action_type: read/list
2+
extensions:
3+
- method: GET
4+
action_type: read/list
65

7-
limits:
8-
- method: GET
9-
action_type: read/list
6+
limits:
7+
- method: GET
8+
action_type: read/list
109

11-
shares:
12-
- method: GET
13-
action_type: read/list
10+
shares:
11+
- method: GET
12+
action_type: read/list
1413

15-
- share:
16-
export_locations:
17-
- method: GET
18-
action_type: read/list
19-
20-
snapshots:
21-
- method: GET
22-
action_type: read/list
14+
- share:
15+
export_locations:
16+
- method: GET
17+
action_type: read/list
2318

24-
snapshot-instances:
25-
- method: GET
26-
action_type: read/list
19+
snapshots:
20+
- method: GET
21+
action_type: read/list
2722

28-
share-networks:
29-
- method: GET
30-
action_type: read/list
23+
snapshot-instances:
24+
- method: GET
25+
action_type: read/list
3126

32-
security-services:
33-
- method: GET
34-
action_type: read/list
27+
share-networks:
28+
- method: GET
29+
action_type: read/list
3530

36-
share-servers:
37-
- method: GET
38-
action_type: read/list
31+
security-services:
32+
- method: GET
33+
action_type: read/list
3934

40-
share_instances:
41-
- method: GET
42-
action_type: read/list
35+
share-servers:
36+
- method: GET
37+
action_type: read/list
4338

44-
- share_instance:
45-
- export_locations:
46-
- method: GET
47-
action_type: read/list
39+
share_instances:
40+
- method: GET
41+
action_type: read/list
4842

49-
types:
50-
- method: GET
51-
action_type: read/list
43+
- share_instance:
44+
- export_locations:
45+
- method: GET
46+
action_type: read/list
5247

53-
- default:
54-
- method: GET
55-
action_type: read/list
48+
types:
49+
- method: GET
50+
action_type: read/list
5651

57-
scheduler-stats:
58-
pools:
52+
- default:
5953
- method: GET
6054
action_type: read/list
6155

62-
services:
56+
scheduler-stats:
57+
pools:
6358
- method: GET
6459
action_type: read/list
6560

66-
availability-zones:
67-
- method: GET
68-
action_type: read/list
61+
services:
62+
- method: GET
63+
action_type: read/list
6964

70-
messages:
71-
- method: GET
72-
action_type: read/list
65+
availability-zones:
66+
- method: GET
67+
action_type: read/list
7368

74-
share-replicas:
75-
- method: GET
76-
action_type: read/list
69+
messages:
70+
- method: GET
71+
action_type: read/list
7772

78-
share_groups:
79-
- method: GET
80-
action_type: read/list
73+
share-replicas:
74+
- method: GET
75+
action_type: read/list
8176

82-
share-group-types:
83-
- method: GET
84-
action_type: read/list
77+
share_groups:
78+
- method: GET
79+
action_type: read/list
8580

86-
share-group-snapshots:
87-
- method: GET
88-
action_type: read/list
81+
share-group-types:
82+
- method: GET
83+
action_type: read/list
84+
85+
share-group-snapshots:
86+
- method: GET
87+
action_type: read/list

watcher/target_type_uri_strategy.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def __init__(self):
223223
'entries': 'entry'
224224
}
225225
regex_mapping = {
226-
'flavors/[^/]*$': 'flavors/flavor',
226+
'flavors/[^/|$]+': 'flavors/flavor',
227227
}
228228
super(NovaTargetTypeURIStrategy, self).__init__(
229229
name='nova',
@@ -241,7 +241,7 @@ def __init__(self):
241241
'tags': 'tag',
242242
}
243243
regex_mapping = {
244-
'images/[^/]*$': 'images/image',
244+
'images/[^/|$]+': 'images/image',
245245
}
246246
super(GlanceTargetTypeURIStrategy, self).__init__(
247247
name='glance',
@@ -320,7 +320,7 @@ def __init__(self):
320320
'domains/\S+/config/[0-9a-zA-Z_]+/[0-9a-zA-Z_]+$': 'domains/domain/config/group/option',
321321
'domains/\S+/config/[0-9a-zA-Z_]+$': 'domains/domain/config/group',
322322
'domains/[^/]*$': 'domains/domain',
323-
'regions/\S+': 'regions/region',
323+
'regions/[^/]*$': 'regions/region',
324324
'projects/[^/]*$': 'projects/project',
325325
'projects/[0-9a-zA-Z_]+/tags/[^/]*$': 'projects/project/tags/tag',
326326
'users/[^/]*$': 'users/user',
@@ -340,14 +340,14 @@ def __init__(self):
340340
'os-share-unmanage': 'share'
341341
}
342342
regex_mapping = {
343-
'shares/(?!detail)[^/]*$': 'shares/share',
344-
'share-groups/[^/]*$': 'share-groups/share-group',
345-
'share-instances/[^/]*$': 'share-instances/share-instance',
346-
'share-group-types/[^/]*$': 'share-group-types/share-group-type',
347-
'os-share-unmanage/[^/]*$': 'os-share-unmanage/share',
348-
'security-services/[^/]*$': 'security-services/security-service',
349-
'extra_specs/[^/]*$': 'extra_specs/key',
350-
'export_locations/[^/]*$': 'export_locations/export_location'
343+
'shares/(?!detail)[^/|$]+': 'shares/share',
344+
'share-groups/[^/|$]+': 'share-groups/share-group',
345+
'share-instances/[^/|$]+': 'share-instances/share-instance',
346+
'share-group-types/[^/|$]+': 'share-group-types/share-group-type',
347+
'os-share-unmanage/[^/|$]+': 'os-share-unmanage/share',
348+
'security-services/[^/|$]+': 'security-services/security-service',
349+
'extra_specs/[^/|$]+': 'extra_specs/key',
350+
'export_locations/[^/|$]+': 'export_locations/export_location'
351351
}
352352
super(ManilaTargetTypeURIStrategy, self).__init__(
353353
name='manila',

watcher/tests/test_nova.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ def test_target_type_uri(self):
139139
path='/flavors/0123456789abcdef0123456789abcdef'),
140140
'expected': 'service/compute/flavors/flavor'
141141
},
142+
{
143+
'request': fake.create_request(
144+
path='/flavors/0123456789abcdef0123456789abcdef/os-extra_specs'),
145+
'expected': 'service/compute/flavors/flavor/os-extra_specs'
146+
},
147+
{
148+
'request': fake.create_request(
149+
path='flavors/60/os-extra_specs'),
150+
'expected': 'service/compute/flavors/flavor/os-extra_specs'
151+
},
142152
]
143153

144154
for stim in stimuli:

0 commit comments

Comments
 (0)