def sysgroup_exists(self, groupname): """ check if groupname exists """ __LOG.log_d("checking group %s" % (groupname)) config = retrieve_config_infos(self)[1] out = __fapi.file_contains(self.srv_ip, "^" + groupname + ":", config['groupfile']) __LOG.log_d("group %s exists: %s" % (groupname, not out.failed)) return (not out.failed, out)
def get_file_content(self, filename, use_sudo = False): """ retrieve file content """ return __fapi.file_contains(self.srv_ip, pattern, filename)
def file_contains(self, pattern, filename): """ check if file contains pattern """ return __fapi.file_contains(self.srv_ip, pattern, filename)