- call(('mkdir', '-p', path.join(
- self._config_writer_cfg_dir,
- v.vpn_src, 'hosts')))
+ try:
+ os.makedirs(path.join(self._config_writer_cfg_dir,
+ v.vpn_src, 'hosts'))
+ except (IOError, OSError), e:
+ if e.errno != errno.EEXIST:
+ raise HandlerError(u"Can't create VPN config "
+ "directory '%s' (%s)'"
+ % (e.filename, e.strerror))