summaryrefslogtreecommitdiffstats
path: root/lib/container
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 11:40:50 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 12:13:00 +0000
commit0630f78d6b737b38828e3a4245abc69076caffcf (patch)
tree3f0d2401178d2803f2eef26d1a9ae4f959da51c1 /lib/container
parentAdding nwdiag export format to container list command. (diff)
downloadcompute-tools-0630f78d6b737b38828e3a4245abc69076caffcf.tar.xz
compute-tools-0630f78d6b737b38828e3a4245abc69076caffcf.zip
Adding YAML export format to container list command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/list24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/container/list b/lib/container/list
index 45430a4..2be55b5 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -162,6 +162,15 @@ EOF
shell)
echo "${CONTAINER}"
;;
+
+ yaml)
+
+cat << EOF
+ - name: ${CONTAINER}
+ ipv4_address: ${ADDRESS}
+EOF
+
+ ;;
esac
}
@@ -257,6 +266,21 @@ cat << EOF
EOF
;;
+
+ yaml)
+
+cat << EOF
+---
+container_tools:
+ version: ${VERSION}
+
+host:
+ name: ${HOST}
+
+container:
+EOF
+
+ ;;
esac
CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)"