Browse Source

Merge "Add OS-SCH-HNT in extensions list" into stable/rocky

changes/26/675526/1
Zuul 1 month ago
parent
commit
14ccd9d258
2 changed files with 12 additions and 1 deletions
  1. 11
    0
      cinder/api/contrib/scheduler_hints.py
  2. 1
    1
      cinder/api/extensions.py

+ 11
- 0
cinder/api/contrib/scheduler_hints.py View File

@@ -12,6 +12,7 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
+from cinder.api import extensions
15 16
 from cinder.api.schemas import scheduler_hints
16 17
 from cinder.api import validation
17 18
 
@@ -31,3 +32,13 @@ def create(req, body):
31 32
         _validate_scheduler_hints(req=req, body=scheduler_hints_body)
32 33
         body['volume']['scheduler_hints'] = scheduler_hints_body.get(attr)
33 34
     return body
35
+
36
+
37
+# NOTE: This class is added to include "OS-SCH-HNT" in the list extensions
38
+# response and "OS-SCH-HNT" is still not loaded as a standard extension.
39
+class Scheduler_hints(extensions.ExtensionDescriptor):
40
+    """Pass arbitrary key/value pairs to the scheduler."""
41
+
42
+    name = "SchedulerHints"
43
+    alias = "OS-SCH-HNT"
44
+    updated = "2013-04-18T00:00:00+00:00"

+ 1
- 1
cinder/api/extensions.py View File

@@ -31,7 +31,7 @@ import cinder.policy
31 31
 CONF = cfg.CONF
32 32
 
33 33
 LOG = logging.getLogger(__name__)
34
-FILES_TO_SKIP = ['resource_common_manage.py', 'scheduler_hints.py']
34
+FILES_TO_SKIP = ['resource_common_manage.py']
35 35
 
36 36
 
37 37
 class ExtensionDescriptor(object):

Loading…
Cancel
Save