为什么我收到“没有找到主机”?以下是我的代码,如何解决?
def upload_log(self, instance_name, logfile):
''' Uploads an RDS log to S3 given the instance_name and the log file
name. '''
log = self._get_log_file(instance_name, logfile)
key = '/'.join([instance_name, log.log_filename])
try:
print r'uploading logfile {} to s3://{}'.format(log.log_filename,
key)
self._write_key(key, log.data)
print 'uploaded logfile: {}'.format(key)
except Exception as e:
os.chdir("/LogFiles/")
#Getting No hosts found when it comes in except block somewhere here-->
command1 = "rds-download-db-logfile pgd-1 --log-file-name error/{0} > {0}".format(log.log_filename)
os.system(command1)
command2 = "s3cmd put {} s3://rds-logproduction/pgd-1/error/".format(log.log_filename)
os.system(command2)
我正在尝试将日志文件从RDS上传到S3。
所以,当它要求输入主机名时,我会传入“us-west-2.amazonaws.com”,之后我就会
fabric.exceptions.NetworkError: Name lookup failed for us-west-2.amazonaws.com
我错过了什么?
答案 0 :(得分:0)
S3主机名应为s3.amazonaws.com
。