Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vmdriver
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
Commit
4bc5e04e
authored
Jan 07, 2022
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introducing celeryconfig.py
requirements and encoding fix
parent
fe4837f7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
13 deletions
+34
-13
celeryconfig.py
+6
-0
netcelery.py
+3
-2
requirements/base.txt
+17
-6
vm.py
+3
-3
vmcelery.py
+4
-2
vmdriver.py
+1
-0
No files found.
celeryconfig.py
0 → 100644
View file @
4bc5e04e
CELERY_RESULT_BACKEND
=
'amqp://'
CELERY_TASK_RESULT_EXPIRES
=
300
CELERY_TIMEZONE
=
'UTC'
CELERY_ENABLE_UTC
=
True
CELERY_ACCEPT_CONTENT
=
[
'pickle'
,
'json'
,
'msgpack'
,
'yaml'
]
netcelery.py
View file @
4bc5e04e
...
@@ -36,11 +36,12 @@ celery = Celery('netcelery',
...
@@ -36,11 +36,12 @@ celery = Celery('netcelery',
broker
=
AMQP_URI
,
broker
=
AMQP_URI
,
include
=
[
'netdriver'
])
include
=
[
'netdriver'
])
celery
.
config_from_object
(
'celeryconfig'
)
celery
.
conf
.
update
(
celery
.
conf
.
update
(
CELERY_RESULT_BACKEND
=
'amqp://'
,
CELERY_TASK_RESULT_EXPIRES
=
300000
,
CELERY_QUEUES
=
(
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
,
Exchange
(
Queue
(
HOSTNAME
,
Exchange
(
'netdriver'
,
type
=
'direct'
),
routing_key
=
"netdriver"
),
'netdriver'
,
type
=
'direct'
),
routing_key
=
"netdriver"
),
)
)
)
)
requirements/base.txt
View file @
4bc5e04e
celery
amqp==1.4.9
decorator
billiard==3.3.0.23
lxml
celery==3.1.18
psutil
decorator==3.4.0
Pillow
future==0.18.2
GitPython
#GitPython==0.3.6
GitPython==3.1.18
importlib-metadata==4.8.3
kombu==3.0.30
lxml==3.4.2
pillow==8.4.0
psutil==4.4.2
pytz==2021.3
smmap==5.0.0
typing_extensions==4.0.1
vine==5.0.0
zipp==3.6.0
vm.py
View file @
4bc5e04e
...
@@ -173,7 +173,7 @@ class VMInstance:
...
@@ -173,7 +173,7 @@ class VMInstance:
def
dump_xml
(
self
):
def
dump_xml
(
self
):
return
ET
.
tostring
(
self
.
build_xml
(),
return
ET
.
tostring
(
self
.
build_xml
(),
encoding
=
'u
tf8
'
,
encoding
=
'u
nicode
'
,
method
=
'xml'
,
method
=
'xml'
,
pretty_print
=
True
)
pretty_print
=
True
)
...
@@ -231,7 +231,7 @@ class VMDisk:
...
@@ -231,7 +231,7 @@ class VMDisk:
def
dump_xml
(
self
):
def
dump_xml
(
self
):
return
ET
.
tostring
(
self
.
build_xml
(),
return
ET
.
tostring
(
self
.
build_xml
(),
encoding
=
'u
tf8
'
,
encoding
=
'u
nicode
'
,
method
=
'xml'
,
method
=
'xml'
,
pretty_print
=
True
)
pretty_print
=
True
)
...
@@ -323,6 +323,6 @@ class VMNetwork:
...
@@ -323,6 +323,6 @@ class VMNetwork:
return
xml_top
return
xml_top
def
dump_xml
(
self
):
def
dump_xml
(
self
):
return
ET
.
tostring
(
self
.
build_xml
(),
encoding
=
'u
tf8
'
,
return
ET
.
tostring
(
self
.
build_xml
(),
encoding
=
'u
nicode
'
,
method
=
'xml'
,
method
=
'xml'
,
pretty_print
=
True
)
pretty_print
=
True
)
vmcelery.py
View file @
4bc5e04e
...
@@ -42,11 +42,13 @@ celery = Celery('vmcelery',
...
@@ -42,11 +42,13 @@ celery = Celery('vmcelery',
broker
=
AMQP_URI
,
broker
=
AMQP_URI
,
include
=
[
'vmdriver'
])
include
=
[
'vmdriver'
])
celery
.
config_from_object
(
'celeryconfig'
)
celery
.
conf
.
update
(
celery
.
conf
.
update
(
CELERY_RESULT_BACKEND
=
'amqp://'
,
CELERY_TASK_RESULT_EXPIRES
=
300000
,
CELERY_QUEUES
=
(
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
,
Exchange
(
Queue
(
HOSTNAME
,
Exchange
(
'vmdriver'
,
type
=
'direct'
),
routing_key
=
"vmdriver"
),
'vmdriver'
,
type
=
'direct'
),
routing_key
=
"vmdriver"
),
)
)
)
)
vmdriver.py
View file @
4bc5e04e
...
@@ -183,6 +183,7 @@ def create(vm_desc):
...
@@ -183,6 +183,7 @@ def create(vm_desc):
domain
.
suspend
()
domain
.
suspend
()
# Real driver create
# Real driver create
else
:
else
:
logging
.
info
(
"Virtual machine
%
s being created from xml"
,
vm
.
name
)
Connection
.
get
()
.
createXML
(
Connection
.
get
()
.
createXML
(
vm_xml_dump
,
libvirt
.
VIR_DOMAIN_START_PAUSED
)
vm_xml_dump
,
libvirt
.
VIR_DOMAIN_START_PAUSED
)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
...
...
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