def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since two options may map to OSG_SITE_NAME """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self) if self.ignored: self.log("%s.get_attributes completed" % self.__class__) return dict( zip([ item.mapping for item in self.options.values() if item.is_mappable() ], [ str(item.value) for item in self.options.values() if item.is_mappable() ])) elif not self.enabled: self.log("%s.get_attributes completed" % self.__class__) return attributes elif self.options['location'].value in ('None', 'UNAVAILABLE'): del attributes['OSG_SQUID_LOCATION'] self.log("Blank location or location set to UNAVAILABLE, " + "not setting environment variable") self.log("%s.get_attributes completed" % self.__class__) return attributes self.log("%s.get_attributes completed" % self.__class__) return attributes
def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since two options may map to OSG_SITE_NAME """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self, converter) if attributes == {}: self.log("%s.get_attributes completed" % self.__class__) return attributes if ( "OSG_SITE_NAME" in attributes and self.options["resource"].value is not None and not utilities.blank(self.options["resource"].value) ): attributes["OSG_SITE_NAME"] = self.options["resource"].value self.log("%s.get_attributes completed" % self.__class__) return attributes
def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since two options may map to OSG_SITE_NAME """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self) if self.ignored: self.log("%s.get_attributes completed" % self.__class__) return dict( zip( [item.mapping for item in self.options.values() if item.is_mappable()], [str(item.value) for item in self.options.values() if item.is_mappable()], ) ) elif not self.enabled: self.log("%s.get_attributes completed" % self.__class__) return attributes elif self.options["location"].value in ("None", "UNAVAILABLE"): del attributes["OSG_SQUID_LOCATION"] self.log("Blank location or location set to UNAVAILABLE, " + "not setting environment variable") self.log("%s.get_attributes completed" % self.__class__) return attributes self.log("%s.get_attributes completed" % self.__class__) return attributes
def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since OSG_MANAGEDFORK is bool and needs to be mapped to Y/N """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self, converter=convert_values) if attributes == {}: attributes['OSG_MANAGEDFORK'] = 'N' self.log("%s.get_attributes completed" % self.__class__) return attributes
def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since OSG_MANAGEDFORK is bool and needs to be mapped to Y/N """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self, converter=convert_values) if attributes == {}: attributes['OSG_MANAGEDFORK'] = 'N' self.log("%s.get_attributes completed" % self.__class__) return attributes
def get_attributes(self, converter=str): """ Get attributes for the osg attributes file using the dict in self.options Returns a dictionary of ATTRIBUTE => value mappings Need to override parent class method since two options may map to OSG_SITE_NAME """ self.log("%s.get_attributes started" % self.__class__) attributes = BaseConfiguration.get_attributes(self, converter) if attributes == {}: self.log("%s.get_attributes completed" % self.__class__) return attributes if ('OSG_SITE_NAME' in attributes and self.options['resource'].value is not None and not utilities.blank(self.options['resource'].value)): attributes['OSG_SITE_NAME'] = self.options['resource'].value self.log("%s.get_attributes completed" % self.__class__) return attributes