mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
* Fixed actor version
* Fixed run
This commit is contained in:
parent
4de93ddf1f
commit
428ddd493c
@ -34,14 +34,14 @@ from __future__ import unicode_literals
|
||||
# On centos, old six release does not includes byte2int, nor six.PY2
|
||||
import six
|
||||
|
||||
VERSION = '2.1.0'
|
||||
VERSION = '2.2.0'
|
||||
|
||||
__title__ = 'udsactor'
|
||||
__version__ = VERSION
|
||||
__build__ = 0x010750
|
||||
__build__ = 0x010755
|
||||
__author__ = 'Adolfo Gómez <dkmaster@dkmon.com>'
|
||||
__license__ = "BSD 3-clause"
|
||||
__copyright__ = "Copyright 2014-2016 VirtualCable S.L.U."
|
||||
__copyright__ = "Copyright 2014-2017 VirtualCable S.L.U."
|
||||
|
||||
|
||||
if not hasattr(six, 'byte2int'):
|
||||
|
@ -94,21 +94,18 @@ class CommonService(object):
|
||||
cmd = shlex.split(cmdLine)
|
||||
|
||||
if os.path.isfile(cmd[0]):
|
||||
logger.info('File "{}" was found!!'.format(cmd))
|
||||
if (os.stat(cmd[0]).st_mode & stat.S_IXUSR) != 0:
|
||||
try:
|
||||
# cmd = ["c:\\sysprep\\sysprep.exe", "/generalize", "/oobe", "/reboot", "/quiet", "/unattend:c:\\sysprep\\unattend.xml"]
|
||||
res = subprocess.check_call(cmd)
|
||||
# res = subprocess.check_call([cmd, ], shell=True)
|
||||
except Exception as e:
|
||||
logger.info('Got exception: {} - {}'.format(e, cmd))
|
||||
logger.error('Got exception executing: {} - {}'.format(cmdLine, e))
|
||||
return False
|
||||
logger.info('Result of executing cmd was {}'.format(res))
|
||||
logger.debug('Result of executing cmd was {}'.format(res))
|
||||
return True
|
||||
else:
|
||||
logger.info('{} file exists but it it is not executable (needs execution permission by admin/root)'.format(section))
|
||||
logger.error('{} file exists but it it is not executable (needs execution permission by admin/root)'.format(section))
|
||||
else:
|
||||
logger.info('{} file not found & not executed'.format(section))
|
||||
logger.error('{} file not found & not executed'.format(section))
|
||||
|
||||
return False
|
||||
|
||||
@ -166,10 +163,9 @@ class CommonService(object):
|
||||
self.doWait(5000)
|
||||
|
||||
# Now try to run the "runonce" element
|
||||
logger.info('Running runOnce app')
|
||||
runOnce = store.runApplication()
|
||||
if runOnce is not None:
|
||||
logger.info('Executing {}'.format(runOnce))
|
||||
logger.info('Executing runOnce app: {}'.format(runOnce))
|
||||
if self.execute(runOnce, 'RunOnce') is True:
|
||||
# operations.reboot()
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user