kislyuk / aegea

Amazon Web Services Operator Interface
Apache License 2.0
68 stars 17 forks source link

Initialize on-demand and don't fail on read-only FS #57

Open kislyuk opened 3 years ago

kislyuk commented 3 years ago

Currently, the following works:

import aegea
aegea.initialize()
from aegea.batch import submit, submit_parser
submit(submit_parser.parse_args([...]))

While the following does not:

import aegea
from aegea.batch import submit, submit_parser
aegea.initialize()
submit(submit_parser.parse_args([...]))

This is because the global aegea.config object is rebound at runtime in the init sequence.

Replace the global object with an auto-vivifying placeholder.

Also, init fails on read-only FS. Fall back and print a warning instead of failing.