add 'current' alias
showing installed state
This commit is contained in:
12
install.py
12
install.py
@@ -183,7 +183,7 @@ def write_when_new(filename, content, ignore_reduction=False):
|
||||
print('>>>')
|
||||
print('\n'.join(old[-bottom_lines:-1]))
|
||||
print("===")
|
||||
return True
|
||||
return content
|
||||
|
||||
|
||||
def create_if(name, cfg, mac, dhcp_server_cfg):
|
||||
@@ -447,7 +447,13 @@ def handle_config():
|
||||
if action == 'restart':
|
||||
unix_cmd('systemctl restart %s' % service)
|
||||
unix_cmd('systemctl enable %s' % service)
|
||||
return True
|
||||
result = [f'config file:\n {cfgfile}']
|
||||
for section in parser.sections():
|
||||
result.append(section)
|
||||
for key, value in parser.items(section):
|
||||
result.append(f' {key} = {value}')
|
||||
result.append('')
|
||||
return '\n'.join(result)
|
||||
|
||||
|
||||
doit = False
|
||||
@@ -465,5 +471,7 @@ elif show.dirty and more_info == 'NONE':
|
||||
if answer.lower().startswith('y'):
|
||||
handle_config()
|
||||
walk(Do())
|
||||
with open('/root/aputools/current', 'w') as f:
|
||||
f.write(result)
|
||||
else:
|
||||
print('nothing to do')
|
||||
|
||||
Reference in New Issue
Block a user