Add support for SLAPOS_CONFIGURATION and SLAPOS_CLIENT_CONFIGURATION envvars.

Also update doc
parent 45dc7df0
......@@ -6,10 +6,10 @@ SlapOS command line usage
Note:
-----
* Default configuration file of "Node" commands if not explicitly defined (slapos node, slapos supervisor) is:
/etc/opt/slapos/slapos.cfg
/etc/opt/slapos/slapos.cfg or value of SLAPOS_CONFIGURATION environment variable if exists.
* Default configuration file of "Client" commands if not explicitly defined (slapos request, slapos supply, ...) is:
~/.slapos/slapos.cfg
~/.slapos/slapos.cfg or value of SLAPOS_CLIENT_CONFIGURATION environment variable if exists.
* Default log file for Node commands is /var/log/[slapos-node-software.log | slapos-node-instance.log | slapos-node-report.log]. This one requires working log in slapgrid, currently log/console is a total mess.
......
......@@ -41,8 +41,12 @@ from slapos.grid.svcbackend import supervisord
from slapos.grid.svcbackend import supervisorctl
from slapos.register.register import main as register
GLOBAL_SLAPOS_CONFIGURATION = '/etc/opt/slapos/slapos.cfg'
USER_SLAPOS_CONFIGURATION = '~/.slapos/slapos.cfg'
GLOBAL_SLAPOS_CONFIGURATION = os.environ.get(
'SLAPOS_CONFIGURATION',
'/etc/opt/slapos/slapos.cfg')
USER_SLAPOS_CONFIGURATION = os.environ.get(
'SLAPOS_CLIENT_CONFIGURATION',
os.environ.get('SLAPOS_CONFIGURATION', '~/.slapos/slapos.cfg'))
class EntryPointNotImplementedError(NotImplementedError):
def __init__(self, *args, **kw_args):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment