-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for named networks #43
Conversation
Allow to define `-n <network_name>` to create the VM attached to that network
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bkmeneguello. Thank you for your contribution! This looks great. A couple comments below. Also, could you update the README with the newly added option.
if [ -n "${NETWORK_NAME}" ] | ||
then | ||
NETWORK_PARAMS="$(param network ${NETWORK_NAME})" | ||
elif [ -n "${BRIDGE}" ] | ||
then | ||
NETWORK_PARAMS="$(param bridge ${BRIDGE})" | ||
else | ||
NETWORK_PARAMS="none" | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -691,6 +702,10 @@ _EOF_ | |||
outputn "Cleaning up cloud-init files" | |||
rm -f $USER_DATA $META_DATA $CI_ISO && ok | |||
|
|||
if [ -n "${NETWORK_NAME}" ]; then | |||
BRIDGE=$(virsh net-dumpxml "${NETWORK_NAME}" | awk -F\' '/bridge/ {print $2}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit nervous about splitting on the first single quote. What if name=
is not first in the bridge tag?
What about something like: virsh net-info "${NETWORK_NAME}" | awk -F':' '/Bridge/ {print $2}' | tr -d ' '
?
Thoughts?
Are you still working on this PR? |
Following suggestion from 22-Oct-2019 in stale PR giovtorres#43 to upstream fork
Allow to define
-n <network_name>
to create the VM attached to that networkProbably fixes #16