'Test attach the volume in maintenance.'

def test_volume_attach_in_maintenance(self):

    test_meta1 = {'fake_key1': 'fake_value1', 'fake_key2': 'fake_value2'}
    volume = tests_utils.create_volume(self.context, metadata=test_meta1, **self.volume_params)
    volume['status'] = 'maintenance'
    self.assertRaises(exception.InvalidVolume, self.volume_api.attach, self.context, volume, None, None, None, None)
