Since KVM only allows /dev/vd[a-z], we validate that implementation-specific
sd[a-z] is rejected by heat validation.
See:
http://docs.openstack.org/trunk/openstack-compute/admin/content/managing-volumes.html
Search device name
Resolves issue #71
Signed-off-by: Steven Dake <sdake@redhat.com>
import eventlet
import logging
import os
+import re
from heat.common import exception
from heat.engine.resources import Resource
else:
self.state_set(self.CREATE_FAILED)
+ def validate(self):
+ '''
+ Validate the mountpoint device
+ '''
+ device_re = re.compile('/dev/vd[b-z]')
+ if re.match(device_re, self.t['Properties']['Device']):
+ return None
+ else:
+ return 'MountPoint.Device must be in format /dev/vd[b-z]'
+
def delete(self):
if self.state == self.DELETE_IN_PROGRESS or \
self.state == self.DELETE_COMPLETE: