Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
fwdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
d3232968
authored
Oct 05, 2022
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wombat fix
parent
406df685
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
ovs.py
+7
-0
requirements/base.txt
+1
-0
utils.py
+3
-3
No files found.
ovs.py
View file @
d3232968
...
@@ -3,6 +3,13 @@ from subprocess import CalledProcessError
...
@@ -3,6 +3,13 @@ from subprocess import CalledProcessError
import
logging
import
logging
from
utils
import
NETNS
,
sudo
,
ns_exec
,
HA
from
utils
import
NETNS
,
sudo
,
ns_exec
,
HA
from
functools
import
reduce
try
:
# Python 2: "unicode" is built-in
unicode
except
NameError
:
unicode
=
str
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
requirements/base.txt
View file @
d3232968
...
@@ -2,6 +2,7 @@ amqp==1.4.9
...
@@ -2,6 +2,7 @@ amqp==1.4.9
anyjson==0.3.3
anyjson==0.3.3
billiard==3.3.0.23
billiard==3.3.0.23
celery==3.1.18
celery==3.1.18
Django==3.2.3
kombu==3.0.30
kombu==3.0.30
netaddr==0.8.0
netaddr==0.8.0
python-dateutil==2.8.2
python-dateutil==2.8.2
...
...
utils.py
View file @
d3232968
...
@@ -49,15 +49,15 @@ def sudo(args, stdin=None):
...
@@ -49,15 +49,15 @@ def sudo(args, stdin=None):
args
=
(
'/usr/bin/sudo'
,
)
+
args
args
=
(
'/usr/bin/sudo'
,
)
+
args
logger
.
debug
(
'EXEC {}'
.
format
(
' '
.
join
(
args
)))
logger
.
debug
(
'EXEC {}'
.
format
(
' '
.
join
(
args
)))
p
=
sp
.
Popen
(
args
,
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
,
stdout
=
sp
.
PIPE
)
p
=
sp
.
Popen
(
args
,
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
,
stdout
=
sp
.
PIPE
,
encoding
=
'utf-8'
)
if
isinstance
(
stdin
,
basestring
):
if
isinstance
(
stdin
,
basestring
):
stdout
,
stderr
=
p
.
communicate
(
bytes
(
stdin
,
'utf-8'
)
)
stdout
,
stderr
=
p
.
communicate
(
stdin
)
else
:
else
:
stdout
,
stderr
=
p
.
communicate
()
stdout
,
stderr
=
p
.
communicate
()
if
p
.
returncode
!=
0
:
if
p
.
returncode
!=
0
:
raise
sp
.
CalledProcessError
(
raise
sp
.
CalledProcessError
(
p
.
returncode
,
sp
.
list2cmdline
(
args
),
stderr
)
p
.
returncode
,
sp
.
list2cmdline
(
args
),
stderr
)
return
st
r
(
stdout
)
return
st
dout
def
ns_exec
(
args
,
stdin
=
None
):
def
ns_exec
(
args
,
stdin
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment