Wrong hint key in volume create function
Hint key has to be 'OS-SCH-HNT:scheduler_hints' not 'scheduler_hints' and scheduler_hints key has to be located in same level with volume. Change-Id: Ic5888545d4b7ee6bb58a22840928ef1fc86fedfa Closes-Bug: #1276088
This commit is contained in:
		
							
								
								
									
										1
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								.mailmap
									
									
									
									
									
								
							@@ -13,3 +13,4 @@ Andy Smith <github@anarkystic.com> termie <github@anarkystic.com>
 | 
				
			|||||||
<matt.dietz@rackspace.com> <matthew.dietz@gmail.com>
 | 
					<matt.dietz@rackspace.com> <matthew.dietz@gmail.com>
 | 
				
			||||||
Nikolay Sokolov <nsokolov@griddynamics.com> Nokolay Sokolov <nsokolov@griddynamics.com>
 | 
					Nikolay Sokolov <nsokolov@griddynamics.com> Nokolay Sokolov <nsokolov@griddynamics.com>
 | 
				
			||||||
Nikolay Sokolov <nsokolov@griddynamics.com> Nokolay Sokolov <chemikadze@gmail.com>
 | 
					Nikolay Sokolov <nsokolov@griddynamics.com> Nokolay Sokolov <chemikadze@gmail.com>
 | 
				
			||||||
 | 
					<skanddh@gmail.com> <seungkyu.ahn@samsung.com>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,6 +36,24 @@ class VolumesTest(utils.TestCase):
 | 
				
			|||||||
        cs.volumes.create(1)
 | 
					        cs.volumes.create(1)
 | 
				
			||||||
        cs.assert_called('POST', '/volumes')
 | 
					        cs.assert_called('POST', '/volumes')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_create_volume_with_hint(self):
 | 
				
			||||||
 | 
					        cs.volumes.create(1, scheduler_hints='uuid')
 | 
				
			||||||
 | 
					        expected = {'volume': {'status': 'creating',
 | 
				
			||||||
 | 
					                               'description': None,
 | 
				
			||||||
 | 
					                               'availability_zone': None,
 | 
				
			||||||
 | 
					                               'source_volid': None,
 | 
				
			||||||
 | 
					                               'snapshot_id': None,
 | 
				
			||||||
 | 
					                               'size': 1,
 | 
				
			||||||
 | 
					                               'user_id': None,
 | 
				
			||||||
 | 
					                               'name': None,
 | 
				
			||||||
 | 
					                               'imageRef': None,
 | 
				
			||||||
 | 
					                               'attach_status': 'detached',
 | 
				
			||||||
 | 
					                               'volume_type': None,
 | 
				
			||||||
 | 
					                               'project_id': None,
 | 
				
			||||||
 | 
					                               'metadata': {}},
 | 
				
			||||||
 | 
					                    'OS-SCH-HNT:scheduler_hints': 'uuid'}
 | 
				
			||||||
 | 
					        cs.assert_called('POST', '/volumes', body=expected)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_attach(self):
 | 
					    def test_attach(self):
 | 
				
			||||||
        v = cs.volumes.get('1234')
 | 
					        v = cs.volumes.get('1234')
 | 
				
			||||||
        cs.volumes.attach(v, 1, '/dev/vdc', mode='ro')
 | 
					        cs.volumes.attach(v, 1, '/dev/vdc', mode='ro')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -180,8 +180,11 @@ class VolumeManager(base.ManagerWithFind):
 | 
				
			|||||||
                           'metadata': volume_metadata,
 | 
					                           'metadata': volume_metadata,
 | 
				
			||||||
                           'imageRef': imageRef,
 | 
					                           'imageRef': imageRef,
 | 
				
			||||||
                           'source_volid': source_volid,
 | 
					                           'source_volid': source_volid,
 | 
				
			||||||
                           'scheduler_hints': scheduler_hints,
 | 
					 | 
				
			||||||
                           }}
 | 
					                           }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if scheduler_hints:
 | 
				
			||||||
 | 
					            body['OS-SCH-HNT:scheduler_hints'] = scheduler_hints
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return self._create('/volumes', body, 'volume')
 | 
					        return self._create('/volumes', body, 'volume')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get(self, volume_id):
 | 
					    def get(self, volume_id):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user