trying to add vlan using python csv file and nmcli commands, variables not recognized in nmcli commandsWhy...
Jimmy needs your help!
How do I explain that I don't want to maintain old projects?
Four ships at the ocean with the same distance
What is the average number of draws it takes before you can not draw any more cards from the Deck of Many Things?
How to understand flavors and when to use combination of them?
Why did the frequency of the word "черт" (devil) in books increase by a few times since the October Revolution?
Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?
Will Jimmy fall off his platform?
Why no parachutes in the Orion AA2 abort test?
How to have a filled pattern
How do ballistic trajectories work in a ring world?
Intern not wearing safety equipment; how could I have handled this differently?
How to gather entities into sets?
What does the multimeter dial do internally?
What are some bad ways to subvert tropes?
I'm feeling like my character doesn't fit the campaign
Array or vector? Two dimensional array or matrix?
How to evaluate the performance of open source solver?
What are the effects of abstaining from eating a certain flavor?
How was the website able to tell my credit card was wrong before it processed it?
Sense of humor in your sci-fi stories
Which is a better conductor, a very thick rubber wire or a very thin copper wire?
My professor has told me he will be the corresponding author. Will it hurt my future career?
Examples of fluid (including air) being used to transmit digital data?
trying to add vlan using python csv file and nmcli commands, variables not recognized in nmcli commands
Why does this “while read” work in a terminal, but not in a shell script?how to share environment variables between shells like globals related to a master pid?What is the first event/file/log in linux that appears/changes on boot that signalizes network being up?read the file and assign the values to another filecron script: dovecot: unrecognized serviceUniversal non-bash `time` benchmark alternative?How to prevent symbols in an environment variable from escaping?Assigning variables from text in filenameIs it possible to source ~/.profile in the current shell from a script?While loops not looping through all values
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am using python 3.6.5 on Ubuntu.
I want to use the data from a csv file that contains a vpn number, ip address and gateway address to assign variables and then use those variables in nmcli commands to create vlans on a linux box.
I have accomplished the reading of the csv file and assigning the variables. I can print the values without issue.
I have accomplished calling subprocess.call to run the nmcli commands. However, The variables I defined in python are not being recognized in the nmcli commands.
I created a loop to assign each vlan, ip address and gateway address variable to run with each set of nmcli commands.
The nmcli commands have been run manually with actual values for each of the variables without issue.
Example of command:
subprocess.call(["nmcli”,“connection”,”add”,”type”,”vlan”,”con-name”,”${VLAN_NAME}”,”dev”,”${INTERFACE}”,”id”,”${VLAN_NUMBER}"], shell=True)
Not sure why the variables are not being recognized.. They are not recognized if I drop the shell=True also.
shell-script command-substitution
New contributor
add a comment |
I am using python 3.6.5 on Ubuntu.
I want to use the data from a csv file that contains a vpn number, ip address and gateway address to assign variables and then use those variables in nmcli commands to create vlans on a linux box.
I have accomplished the reading of the csv file and assigning the variables. I can print the values without issue.
I have accomplished calling subprocess.call to run the nmcli commands. However, The variables I defined in python are not being recognized in the nmcli commands.
I created a loop to assign each vlan, ip address and gateway address variable to run with each set of nmcli commands.
The nmcli commands have been run manually with actual values for each of the variables without issue.
Example of command:
subprocess.call(["nmcli”,“connection”,”add”,”type”,”vlan”,”con-name”,”${VLAN_NAME}”,”dev”,”${INTERFACE}”,”id”,”${VLAN_NUMBER}"], shell=True)
Not sure why the variables are not being recognized.. They are not recognized if I drop the shell=True also.
shell-script command-substitution
New contributor
add a comment |
I am using python 3.6.5 on Ubuntu.
I want to use the data from a csv file that contains a vpn number, ip address and gateway address to assign variables and then use those variables in nmcli commands to create vlans on a linux box.
I have accomplished the reading of the csv file and assigning the variables. I can print the values without issue.
I have accomplished calling subprocess.call to run the nmcli commands. However, The variables I defined in python are not being recognized in the nmcli commands.
I created a loop to assign each vlan, ip address and gateway address variable to run with each set of nmcli commands.
The nmcli commands have been run manually with actual values for each of the variables without issue.
Example of command:
subprocess.call(["nmcli”,“connection”,”add”,”type”,”vlan”,”con-name”,”${VLAN_NAME}”,”dev”,”${INTERFACE}”,”id”,”${VLAN_NUMBER}"], shell=True)
Not sure why the variables are not being recognized.. They are not recognized if I drop the shell=True also.
shell-script command-substitution
New contributor
I am using python 3.6.5 on Ubuntu.
I want to use the data from a csv file that contains a vpn number, ip address and gateway address to assign variables and then use those variables in nmcli commands to create vlans on a linux box.
I have accomplished the reading of the csv file and assigning the variables. I can print the values without issue.
I have accomplished calling subprocess.call to run the nmcli commands. However, The variables I defined in python are not being recognized in the nmcli commands.
I created a loop to assign each vlan, ip address and gateway address variable to run with each set of nmcli commands.
The nmcli commands have been run manually with actual values for each of the variables without issue.
Example of command:
subprocess.call(["nmcli”,“connection”,”add”,”type”,”vlan”,”con-name”,”${VLAN_NAME}”,”dev”,”${INTERFACE}”,”id”,”${VLAN_NUMBER}"], shell=True)
Not sure why the variables are not being recognized.. They are not recognized if I drop the shell=True also.
shell-script command-substitution
shell-script command-substitution
New contributor
New contributor
New contributor
asked 19 mins ago
yabadabadooyabadabadoo
1
1
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
yabadabadoo is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f528623%2ftrying-to-add-vlan-using-python-csv-file-and-nmcli-commands-variables-not-recog%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
yabadabadoo is a new contributor. Be nice, and check out our Code of Conduct.
yabadabadoo is a new contributor. Be nice, and check out our Code of Conduct.
yabadabadoo is a new contributor. Be nice, and check out our Code of Conduct.
yabadabadoo is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f528623%2ftrying-to-add-vlan-using-python-csv-file-and-nmcli-commands-variables-not-recog%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown