Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
62b131b4
authored
Dec 23, 2019
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..celery: Queue and Exchange names are generated from host name
vmdriver: raw data can contain an XML tree.
parent
bf0de0cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
netcelery.py
+1
-1
vm.py
+7
-1
vmcelery.py
+1
-1
vmdriver.py
+4
-1
No files found.
netcelery.py
View file @
62b131b4
...
...
@@ -41,6 +41,6 @@ celery.conf.update(
CELERY_TASK_RESULT_EXPIRES
=
300
,
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
,
Exchange
(
'netdriver'
,
type
=
'direct'
),
routing_key
=
"netdriver"
),
HOSTNAME
,
type
=
'direct'
),
routing_key
=
HOSTNAME
),
)
)
vm.py
View file @
62b131b4
...
...
@@ -92,8 +92,14 @@ class VMInstance:
'type'
:
self
.
vm_type
})
# Building raw data into xml
# Raw data may contain a tree or a single element
if
self
.
raw_data
:
xml_top
.
append
(
ET
.
fromstring
(
self
.
raw_data
))
raw_data
=
ET
.
fromstring
(
self
.
raw_data
)
if
len
(
raw_data
):
for
child
in
raw_data
:
xml_top
.
append
(
child
)
else
:
xml_top
.
append
(
raw_data
)
# Basic virtual machine paramaters
ET
.
SubElement
(
xml_top
,
'name'
)
.
text
=
self
.
name
ET
.
SubElement
(
xml_top
,
'vcpu'
)
.
text
=
str
(
self
.
vcpu
)
...
...
vmcelery.py
View file @
62b131b4
...
...
@@ -46,6 +46,6 @@ celery.conf.update(
CELERY_TASK_RESULT_EXPIRES
=
300
,
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
,
Exchange
(
'vmdriver'
,
type
=
'direct'
),
routing_key
=
"vmdriver"
),
HOSTNAME
,
type
=
'direct'
),
routing_key
=
HOSTNAME
),
)
)
vmdriver.py
View file @
62b131b4
...
...
@@ -174,7 +174,7 @@ def create(vm_desc):
if
vm
.
vm_type
==
"test"
:
vm
.
arch
=
"i686"
vm_xml_dump
=
vm
.
dump_xml
()
logging
.
info
(
vm_xml_dump
)
logging
.
debug
(
vm_xml_dump
)
# Emulating DOMAIN_START_PAUSED FLAG behaviour on test driver
if
vm
.
vm_type
==
"test"
:
Connection
.
get
()
.
createXML
(
...
...
@@ -186,6 +186,8 @@ def create(vm_desc):
Connection
.
get
()
.
createXML
(
vm_xml_dump
,
libvirt
.
VIR_DOMAIN_START_PAUSED
)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
""" What .. is this ?
# context
try:
sock = socket.create_connection(('127.0.0.1', 1235), 3)
...
...
@@ -195,6 +197,7 @@ def create(vm_desc):
sock.close()
except socket.error:
logging.error('Unable to connect to context server')
"""
return
vm_xml_dump
...
...
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