Skip to content

Commit ab82d1b

Browse files
author
Ben Astell
committed
Merge remote-tracking branch 'origin/console_info' into bastell-discovery_subset
2 parents 25cc04f + 2021248 commit ab82d1b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
@echo "Installing dependencies"
2727
@pip install $(DEPENDENCIES)
2828
@echo "Installing package"
29-
@python setup.py install
29+
@python3 setup.py install
3030
@echo ""
3131
@echo "Done."
3232
@echo ""
@@ -35,15 +35,15 @@ package:
3535
@echo "--------------------------------------------------------------------"
3636
@echo "Building package"
3737
@mkdir -p $(DIST_DIR)/
38-
@python setup.py bdist_wheel --dist-dir=$(DIST_DIR)
38+
@python3 setup.py bdist_wheel --dist-dir=$(DIST_DIR)
3939
@echo ""
4040
@echo "Done."
4141
@echo ""
4242

4343
clean:
4444
@echo ""
4545
@echo "--------------------------------------------------------------------"
46-
@python setup.py clean
46+
@python3 setup.py clean
4747
@echo "Removing *.pyc and __pycache__/ files"
4848
@find . -type f -name "*.pyc" | xargs rm -vrf
4949
@find . -type d -name "__pycache__" | xargs rm -vrf
@@ -60,7 +60,7 @@ develop:
6060
@echo ""
6161
@echo "--------------------------------------------------------------------"
6262
@echo "Setting up development environment"
63-
@python setup.py develop --no-deps -q
63+
@python3 setup.py develop --no-deps -q
6464
@echo ""
6565
@echo "Done."
6666
@echo ""
@@ -69,7 +69,7 @@ undevelop:
6969
@echo ""
7070
@echo "--------------------------------------------------------------------"
7171
@echo "Removing development environment"
72-
@python setup.py develop -q --no-deps --uninstall
72+
@python3 setup.py develop -q --no-deps --uninstall
7373
@echo ""
7474
@echo "Done."
7575
@echo ""

src/pyatsimagebuilder/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,13 @@ def _process_testbed_file(profile, yaml_contents):
505505
if isinstance(dev, dict):
506506
testbed_info[dev_name] = {}
507507
for key in ('os', 'platform', 'model', 'pid', 'type', 'logical'):
508-
if key in dev:
508+
if dev.get(key):
509509
testbed_info[dev_name][key] = dev[key]
510+
if dev.get('connections', {}).get('a'):
511+
port = dev[key]['a'].get('port')
512+
ip = dev[key]['a'].get('ip')
513+
if ip and port:
514+
testbed_info[dev_name]['console'] = f'{ip}:{port}'
510515

511516
def _process_clean_file(profile, yaml_contents):
512517
# Extract bringup information from the clean file and
@@ -581,6 +586,7 @@ def discover_yamls(manifests, search_path, relative_path=None):
581586
msg = f'Error loading YAML file {value} from ' \
582587
f'manifest {manifest["file"]}'
583588
logger.exception(msg)
589+
yaml_contents = None
584590
continue
585591
else:
586592
# YAML file relative path from manifest does not
@@ -590,7 +596,7 @@ def discover_yamls(manifests, search_path, relative_path=None):
590596
logger.warning(msg)
591597

592598
processor = yaml_processors.get(argument)
593-
if processor:
599+
if processor and yaml_contents:
594600
try:
595601
processor(profile, yaml_contents)
596602
except Exception as e:
@@ -599,4 +605,4 @@ def discover_yamls(manifests, search_path, relative_path=None):
599605
f'manifest {manifest["file"]}'
600606
logger.exception(msg)
601607

602-
return manifests
608+
return manifests

0 commit comments

Comments
 (0)