"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/integration/utils/testprogram.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

testprogram.py  (salt-2019.2.0):testprogram.py  (salt-2019.2.1)
skipping to change at line 399 skipping to change at line 399
if CODE_DIR != env_pypath[0]: if CODE_DIR != env_pypath[0]:
env_pypath.insert(0, CODE_DIR) env_pypath.insert(0, CODE_DIR)
if salt.utils.platform.is_windows(): if salt.utils.platform.is_windows():
env_delta['PYTHONPATH'] = ';'.join(env_pypath) env_delta['PYTHONPATH'] = ';'.join(env_pypath)
else: else:
env_delta['PYTHONPATH'] = ':'.join(env_pypath) env_delta['PYTHONPATH'] = ':'.join(env_pypath)
cmd_env = dict(os.environ) cmd_env = dict(os.environ)
cmd_env.update(env_delta) cmd_env.update(env_delta)
if salt.utils.platform.is_windows() and six.PY2:
for k, v in cmd_env.items():
if isinstance(k, six.text_type) or isinstance(v, six.text_type):
cmd_env[k.encode('ascii')] = v.encode('ascii')
popen_kwargs = { popen_kwargs = {
'shell': self.shell, 'shell': self.shell,
'stdout': subprocess.PIPE, 'stdout': subprocess.PIPE,
'env': cmd_env, 'env': cmd_env,
} }
if catch_stderr is True: if catch_stderr is True:
popen_kwargs['stderr'] = subprocess.PIPE popen_kwargs['stderr'] = subprocess.PIPE
if not sys.platform.lower().startswith('win'): if not sys.platform.lower().startswith('win'):
skipping to change at line 805 skipping to change at line 810
cmdline = ' '.join(cmdline) cmdline = ' '.join(cmdline)
for proc in psutils.process_iter(): for proc in psutils.process_iter():
try: try:
for item in proc.cmdline(): for item in proc.cmdline():
if cmdline in item: if cmdline in item:
ret.append(proc) ret.append(proc)
except psutils.NoSuchProcess: except psutils.NoSuchProcess:
# Process exited between when process_iter was invoked and # Process exited between when process_iter was invoked and
# when we tried to invoke this instance's cmdline() func. # when we tried to invoke this instance's cmdline() func.
continue continue
except psutils.AccessDenied:
# We might get access denied if not running as root
if not salt.utils.platform.is_windows():
pinfo = proc.as_dict(attrs=['pid', 'name', 'username'])
log.error('Unable to access process %s, '
'running command %s as user %s',
pinfo['pid'], pinfo['name'], pinfo['username']
)
continue
else: else:
cmd_len = len(cmdline) cmd_len = len(cmdline)
for proc in psutils.process_iter(): for proc in psutils.process_iter():
try: try:
proc_cmdline = proc.cmdline() proc_cmdline = proc.cmdline()
except psutils.NoSuchProcess: except psutils.NoSuchProcess:
# Process exited between when process_iter was invoked and # Process exited between when process_iter was invoked and
# when we tried to invoke this instance's cmdline() func. # when we tried to invoke this instance's cmdline() func.
continue continue
except psutils.AccessDenied: except psutils.AccessDenied:
# We might get access denied if not running as root # We might get access denied if not running as root
continue if not salt.utils.platform.is_windows():
pinfo = proc.as_dict(attrs=['pid', 'name', 'username'])
log.error('Unable to access process %s, '
'running command %s as user %s',
pinfo['pid'], pinfo['name'], pinfo['username']
)
continue
if any((cmdline == proc_cmdline[n:n + cmd_len]) if any((cmdline == proc_cmdline[n:n + cmd_len])
for n in range(len(proc_cmdline) - cmd_len + 1)): for n in range(len(proc_cmdline) - cmd_len + 1)):
ret.append(proc) ret.append(proc)
return ret return ret
def shutdown(self, signum=signal.SIGTERM, timeout=10, wait_for_orphans=0): def shutdown(self, signum=signal.SIGTERM, timeout=10, wait_for_orphans=0):
'''Shutdown a running daemon''' '''Shutdown a running daemon'''
if not self._shutdown: if not self._shutdown:
try: try:
pid = self.wait_for_daemon_pid(timeout) pid = self.wait_for_daemon_pid(timeout)
 End of changes. 3 change blocks. 
1 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)