#!/usr/bin/python3
class f(object):
def debug(*args):
print(' '.join(args))
def is_upstart_system():
if not util.which('initctl'):
print("skipping, no initctl")
#LOG.debug(("Skipping module named %s," " no /sbin/initctl located"), name)
return False
print("HOWDY")
myenv = os.environ.copy()
if 'UPSTART_SESSION' in myenv:
del myenv['UPSTART_SESSION']
check_cmd = ['initctl', 'version']
try:
(out, err) = util.subp(check_cmd, env=myenv)
return 'upstart' in out
except util.ProcessExecutionError as e:
print("'%s' returned '%s', not using upstart" % (' '.join(check_cmd), e.exit_code))
#LOG.debug("'%s' returned '%s', not using upstart", ' '.join(check_cmd), e.exit_code)
return False
import os
from cloudinit import util
LOG = f
print(is_upstart_system())