27 + if not os.path.exists(mapped_device):
28 + raise exception.Error('Mapped device was not found: %s' % mapped_device)
There is a NotFound exception class in /nova/exception.py that may be better that raising the generic error here. Or, alternately, you could raise IOError, as that is what is raised by open() when the file does not exist?
77 + # This is correct for Ubuntu, but might not be right for other distros
78 + rulesfile = os.path.join(fs, 'etc', 'udev', 'rules.d', '70-persistent-net.rules')
79 + yield execute('rm -f %s' % rulesfile)
Best to add a TODO(justinsb) there so it's noted for future improvements :)
Finally, not sure about making Cheetah a dependency here...what do other think?
Hi!
Good stuff, Justin! ++ for long option names :)
A couple tiny nits, though :)
27 + if not os.path. exists( mapped_ device) : Error(' Mapped device was not found: %s' % mapped_device)
28 + raise exception.
There is a NotFound exception class in /nova/exception.py that may be better that raising the generic error here. Or, alternately, you could raise IOError, as that is what is raised by open() when the file does not exist?
77 + # This is correct for Ubuntu, but might not be right for other distros net.rules' )
78 + rulesfile = os.path.join(fs, 'etc', 'udev', 'rules.d', '70-persistent-
79 + yield execute('rm -f %s' % rulesfile)
Best to add a TODO(justinsb) there so it's noted for future improvements :)
Finally, not sure about making Cheetah a dependency here...what do other think?
Cheers!
jay