opentelekomcloud / python-otcclient

(Obsolete) Python bindings to the T-Systems OTC API
MIT License
15 stars 20 forks source link

AttributeError: 'module' object has no attribute 'getIamToken' #67

Closed Andrey-Shatunov closed 6 years ago

Andrey-Shatunov commented 6 years ago

I run, how in your exemple

#!/usr/bin/env python

import sys
import os

from otcclient.core.userconfigaction import userconfigaction
from otcclient.core.configloader import configloader
from otcclient.core.OtcConfig import OtcConfig
from otcclient.plugins.ecs import ecs

if __name__ == '__main__':
    configloader.readUserValues() 
    configloader.readProxyValues()

    OtcConfig.OUTPUT_FORMAT = "Json"

    ecs.getIamToken()
    ecs.describe_vpcs()

And get

 ecs.getIamToken()
AttributeError: 'module' object has no attribute 'getIamToken'
zsoltn commented 6 years ago

See my changes in README file.

!/usr/bin/env python

import sys import os

from otcclient.core.userconfigaction import userconfigaction from otcclient.core.configloader import configloader from otcclient.core.OtcConfig import OtcConfig from otcclient.plugins.ecs.ecs import ecs #<=== here have to use the CLASS NOT A MODULE

if name == 'main': configloader.readUserValues() configloader.readProxyValues()

OtcConfig.OUTPUT_FORMAT = "Json"

ecs.getIamToken()    
ecs.describe_vpcs()