Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1002)

Unified Diff: server/site_host_attributes.py

Issue 1837002: Fix bug in site_host_attributes. (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: patch 3 Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_host_attributes.py
diff --git a/server/site_host_attributes.py b/server/site_host_attributes.py
index c432af82fe156574fd8e8f8f9e25dc661078f9f2..180d0586c35612b84365fc8a11d8eecf0b6ff239 100644
--- a/server/site_host_attributes.py
+++ b/server/site_host_attributes.py
@@ -79,7 +79,8 @@ class HostAttributes(object):
self._add_attributes(private_host_attributes[host])
if has_models:
host_obj = models.Host.valid_objects.get(hostname=host)
- self._add_attributes(host_obj.labels.all())
+ self._add_attributes([label.name for label in
+ host_obj.labels.all()])
for key, value in self.__dict__.items():
logging.info('Host attribute: %s => %s', key, value)
@@ -88,13 +89,13 @@ class HostAttributes(object):
for attribute in attributes:
splitnames = attribute.split(',')
value = ','.join(splitnames[1:])
+ if len(splitnames) == 1:
+ continue
if value == 'True':
value = True
elif value == 'False':
value = False
elif splitnames[1] == 'string':
- value = ','.join(splitnames[2:])
- else:
- log.info('Non-attribute string "%s" is ignored' % attribute)
+ logging.info('Non-attribute string "%s" is ignored' % attribute)
continue
setattr(self, splitnames[0], value)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698