def get_archivepath(self): """Path to old job data files""" ourpath = self.values['archivejobpath'] if self._get_relative_path(ourpath): return self._get_relative_path(ourpath) else: OUTPUT.warning( 'Not able to resolve the archivejobpath in your configuration file - {0}' .format(ourpath)) return os.path.abspath(ourpath)
def get_logpath(self): """Path to log files""" ourpath = self.values['logpath'] if self._get_relative_path(ourpath): return self._get_relative_path(ourpath) else: OUTPUT.warning( 'Not able to resolve the logpath in your configuration file - {0}' .format(ourpath)) return os.path.abspath(ourpath)
def get_workingjobpath(self): """Path of job data files this script produces""" ourpath = self.values['workingjobpath'] if self._get_relative_path(ourpath): return self._get_relative_path(ourpath) else: OUTPUT.warning( 'Not able to resolve the workingjobpath in your configuration file - {0}' .format(ourpath)) return os.path.abspath(ourpath)
def get_ansibletemplatepath(self): """Path of local ansible template files""" ourpath = self.values['ansibletemplatepath'] if self._get_relative_path(ourpath): return self._get_relative_path(ourpath) else: OUTPUT.warning( 'Not able to resolve the ansibletemplatepath in your configuration file - {0}' .format(ourpath)) return os.path.abspath(ourpath)
def _add_log(self, mylog, logtype='info'): """Add a log generated from this module""" if logtype == 'error': OUTPUT.error('{0}: {1}'.format(str(self.__class__.__name__), str(mylog))) elif logtype == 'warning': OUTPUT.warning('{0}: {1}'.format(str(self.__class__.__name__), str(mylog))) else: OUTPUT.info('{0}: {1}'.format(str(self.__class__.__name__), str(mylog)))