1
0
mirror of https://github.com/newnius/YAO-Dockerfiles.git synced 2025-06-06 07:51:54 +00:00

update, exit with real exitCode

This commit is contained in:
Newnius 2020-07-02 21:16:22 +08:00
parent 3235fcb697
commit eb0e494f20
4 changed files with 10 additions and 2 deletions

View File

@ -17,5 +17,9 @@ fi
# use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment # use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment
eval $@ eval $@
code=$?
# persist output # persist output
python /etc/save.py python /etc/save.py
exit $code

View File

@ -15,6 +15,6 @@ if __name__ == '__main__':
client = Client(hdfs_address) client = Client(hdfs_address)
client.upload(hdfs_dir, output_dir) client.upload(hdfs_dir, output_dir)
print('Save ' + output_dir + 'to' + hdfs_address + ' ' + hdfs_dir) print('Save ' + output_dir + ' to' + hdfs_address + ' ' + hdfs_dir)
except Exception as e: except Exception as e:
print('Unable to persist data to HDFS,', str(e)) print('Unable to persist data to HDFS,', str(e))

View File

@ -17,5 +17,9 @@ fi
# use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment # use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment
eval $@ eval $@
code=$?
# Persist output # Persist output
python /etc/save.py python /etc/save.py
exit $code

View File

@ -15,6 +15,6 @@ if __name__ == '__main__':
client = Client(hdfs_address) client = Client(hdfs_address)
client.upload(hdfs_dir, output_dir) client.upload(hdfs_dir, output_dir)
print('Save ' + output_dir + 'to' + hdfs_address + ' ' + hdfs_dir) print('Save ' + output_dir + ' to' + hdfs_address + ' ' + hdfs_dir)
except Exception as e: except Exception as e:
print('Unable to persist data to HDFS,', str(e)) print('Unable to persist data to HDFS,', str(e))