解决腾讯云按量ECS采集失败
This commit is contained in:
parent
df58f61bea
commit
b0eea76655
|
@ -71,7 +71,8 @@ def ecs(account,region):
|
|||
ecs_dict_temp = {i.InstanceId:{'name':i.InstanceName,'group':group_dict.get(str(i.Placement.ProjectId),'无'),
|
||||
'ostype': 'windows' if 'win' in i.OsName.lower() else 'linux',
|
||||
'status': i.InstanceState, 'region': region, 'ip':i.PrivateIpAddresses[0],
|
||||
'cpu': f'{i.CPU}核','mem': f'{i.Memory}GB','exp': i.ExpiredTime.split('T')[0]
|
||||
'cpu': f'{i.CPU}核','mem': f'{i.Memory}GB',
|
||||
'exp': '按量' if i.ExpiredTime is None else i.ExpiredTime.split('T')[0]
|
||||
} for i in ecs_list}
|
||||
offset = offset + 100
|
||||
ecs_dict.update(ecs_dict_temp)
|
||||
|
|
Loading…
Reference in New Issue