i am calling this command : GITID=sh( 'git describe --dirty --long --tags --abbrev=10 | sed -e "s:/:__:g"' ).strip()
by python subprocess.Popen
try:
# Check file can be read: throws exception if cannot be read
f = open(self.path, "r")
# Calls nyq to process yaml: throws exception if exit code!=0 => check=True
# TODO : use object, as soon as nyq becomes part of mcook legacy code
proc = subprocess.Popen(["nyq", self.path, str('regressions.' + self.regressionName)],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8')
stdout, stderr = proc.communicate()
# TODO : Add check for nyq execution exit code
if proc.returncode != 0:
logging.error(
"Error executing nyq ({})".format(proc.returncode))
raise Exception(stdout)
# Creates YAML object from output of nyq: throws exception if content is not a valid YAML stream
list_files = stdout
self.parsed_data = yaml.load(list_files) # load EMC data
except Exception as exc:
logging.error("An error occured during nested YAML processing:")
logging.error(exc)
sys.exit(1)
can't understand why i am getting this error : enter image description here
Resolved : GITID=sh( 'git describe --dirty --long --tags --abbrev=10').replace('/', '__').strip()
Using replace instead of sed!