def get_platform_label(self): """ Return the platform label, or None if platform label is not set. """ if self.job: keyval_path = os.path.join(self.job.resultdir, "host_keyvals", self.hostname) keyvals = utils.read_keyval(keyval_path) return keyvals.get("platform", None) else: return None
def get_platform_label(self): """ Return the platform label, or None if platform label is not set. """ if self.job: keyval_path = os.path.join(self.job.resultdir, 'host_keyvals', self.hostname) keyvals = utils.read_keyval(keyval_path) return keyvals.get('platform', None) else: return None
def get_all_labels(self): """ Return all labels, or empty list if label is not set """ if self.job: keyval_path = os.path.join(self.job.resultdir, "host_keyvals", self.hostname) keyvals = utils.read_keyval(keyval_path) all_labels = keyvals.get("labels", "") if all_labels: all_labels = all_labels.split(",") return [urllib.unquote(label) for label in all_labels] return []
def get_all_labels(self): """ Return all labels, or empty list if label is not set """ if self.job: keyval_path = os.path.join(self.job.resultdir, 'host_keyvals', self.hostname) keyvals = utils.read_keyval(keyval_path) all_labels = keyvals.get('labels', '') if all_labels: all_labels = all_labels.split(',') return [urllib.unquote(label) for label in all_labels] return []