do not consider network installs when not specified
This commit is contained in:
@ -15,6 +15,7 @@ import filecmp
|
||||
import re
|
||||
import types
|
||||
import socket
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from subprocess import Popen, PIPE
|
||||
from ipaddress import IPv4Interface
|
||||
@ -520,9 +521,9 @@ def handle_config():
|
||||
box.typ = 'bare-apu'
|
||||
elif box.typ == 'cm4':
|
||||
box.typ = 'dual-eth-rpi'
|
||||
print('This is a cm4, so guess its a dual-eth-rpi - please check type in cfg file')
|
||||
print('This is a cm4, so guess its a dual-eth-rpi - please check type in created cfg file')
|
||||
elif box.typ == 'cm3':
|
||||
print('This is a cm3 so guess its a ionopimax - please check type in cfg file')
|
||||
print('This is a cm3 so guess its a ionopimax - please check type in created cfg file')
|
||||
box.typ = 'ionopimax'
|
||||
template = TEMPLATES.get(box.typ)
|
||||
if template is None:
|
||||
@ -542,10 +543,9 @@ def handle_config():
|
||||
config = box.read_config()
|
||||
cfgfile = box.cfgfile
|
||||
if box.hostname_changed or box.hostname != newhostname:
|
||||
print('changed', box.hostname, newhostname)
|
||||
box.hostname_changed = True
|
||||
if cfgfile:
|
||||
newhostname = cfgfile.stem.rpartition('_')[0]
|
||||
newhostname = cfgfile.stem.split('_')[0]
|
||||
if doit:
|
||||
print('bash sethostname.sh')
|
||||
unix_cmd('bash', f'{TOOLS}/sethostname.sh')
|
||||
@ -561,6 +561,7 @@ def handle_config():
|
||||
ifname = ''
|
||||
try:
|
||||
netcfg = config.get('NETWORK', {})
|
||||
if netcfg: # when not network is specified, do not handle network at all
|
||||
for name in netcfg:
|
||||
if name not in box.network_interfaces:
|
||||
print(f'{name} is not a valid network interface name')
|
||||
|
Reference in New Issue
Block a user