Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
David Johnson
openstack-build-ubuntu
Commits
59bfb95c
Commit
59bfb95c
authored
May 31, 2016
by
David Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make openstack-slothd work for Kilo.
parent
6d8d114e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
openstack-slothd.py
openstack-slothd.py
+12
-2
setup-controller.sh
setup-controller.sh
+1
-1
No files found.
openstack-slothd.py
View file @
59bfb95c
...
@@ -151,7 +151,16 @@ def get_hypervisor_hostname(client,resource):
...
@@ -151,7 +151,16 @@ def get_hypervisor_hostname(client,resource):
pass
pass
pass
pass
#LOG.debug("resource: " + pp.pformat(resource))
#LOG.debug("resource: " + pp.pformat(resource))
hh
=
None
try
:
hh
=
resource
.
metadata
[
'host'
]
hh
=
resource
.
metadata
[
'host'
]
except
:
if
'instance_id'
in
resource
.
metadata
:
LOG
.
info
(
"no hostname info for resource %s; trying instance_id"
%
(
str
(
resource
),))
return
get_hypervisor_hostname
(
client
,
get_resource
(
client
,
resource
.
metadata
[
'instance_id'
]))
else
:
LOG
.
exception
(
"no 'host' field in metadata for resource %s"
%
(
str
(
resource
,)))
pass
if
not
hh
in
r_hostnames
.
keys
():
if
not
hh
in
r_hostnames
.
keys
():
LOG
.
error
(
"hostname hash %s doesn't map to a known hypervisor hostname!"
%
(
hh
,))
LOG
.
error
(
"hostname hash %s doesn't map to a known hypervisor hostname!"
%
(
hh
,))
return
None
return
None
...
@@ -236,7 +245,8 @@ def fetchall(client):
...
@@ -236,7 +245,8 @@ def fetchall(client):
if
not
hostname
in
vm_dict
:
if
not
hostname
in
vm_dict
:
vm_dict
[
hostname
]
=
{}
vm_dict
[
hostname
]
=
{}
pass
pass
if
not
vmrid
in
vm_dict
[
hostname
]:
if
not
vmrid
in
vm_dict
[
hostname
]
and
'display_name'
in
resource
.
metadata
\
and
'image.name'
in
resource
.
metadata
and
'status'
in
resource
.
metadata
:
vm_dict
[
hostname
][
vmrid
]
=
dict
(
name
=
resource
.
metadata
[
'display_name'
],
vm_dict
[
hostname
][
vmrid
]
=
dict
(
name
=
resource
.
metadata
[
'display_name'
],
image
=
resource
.
metadata
[
'image.name'
],
image
=
resource
.
metadata
[
'image.name'
],
status
=
resource
.
metadata
[
'status'
])
status
=
resource
.
metadata
[
'status'
])
...
...
setup-controller.sh
View file @
59bfb95c
...
@@ -2721,7 +2721,7 @@ fi
...
@@ -2721,7 +2721,7 @@ fi
#
#
# Install and startup the slothd-for-openstack idleness detector
# Install and startup the slothd-for-openstack idleness detector
#
#
if
[
$OSVERSION
-ge
$OS
LIBERTY
]
;
then
if
[
$OSVERSION
-ge
$OS
KILO
]
;
then
cp
-p
$DIRNAME
/openstack-slothd.py
$OURDIR
/
cp
-p
$DIRNAME
/openstack-slothd.py
$OURDIR
/
cat
<<
EOF
>/etc/systemd/system/openstack-slothd.service
cat
<<
EOF
>/etc/systemd/system/openstack-slothd.service
...
...
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