move to types config
This commit is contained in:
@ -183,6 +183,8 @@ def main():
|
||||
print("No devices found in config file")
|
||||
sys.exit(1)
|
||||
|
||||
types = config.get('types', {})
|
||||
|
||||
success_count = 0
|
||||
total_count = len(devices)
|
||||
|
||||
@ -191,6 +193,11 @@ def main():
|
||||
|
||||
user = device_config.get('user')
|
||||
commands = device_config.get('commands', [])
|
||||
device_type = device_config.get('type')
|
||||
|
||||
# If device has a type, get commands from types section
|
||||
if device_type and device_type in types:
|
||||
commands = types[device_type].get('commands', [])
|
||||
|
||||
if not user:
|
||||
print(f"No user specified for {hostname}, skipping")
|
||||
|
Reference in New Issue
Block a user