使用python-digitalocean模块。
我要在创建Droplet之后抓取ipv4。
actions = droplet.get_actions()
for action in actions:
while action.status != 'completed':
action.load()
# Once it shows complete, droplet is up and running
print (action.status)
print(droplet.ip_address)
这将返回None
谢谢!
答案 0 :(得分:0)
您必须刷新液滴数据,尝试像这样
droplet.load()
print(droplet.ip_address)