Total Complexity | 2 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from libcloud.compute.providers import Provider |
||
6 | class SoftlayerBaseAction(Action): |
||
7 | def __init__(self, config): |
||
8 | # Handy translation from our parameters to libcloud ones |
||
9 | self.st2_to_libcloud = { |
||
10 | "domain": "ex_domain", |
||
11 | "os": "ex_os", |
||
12 | "ram": "ex_ram", |
||
13 | "disk": "ex_disk", |
||
14 | "cpus": "ex_cpus", |
||
15 | "bandwith": "ex_bandwidth", |
||
16 | "local_disk": "ex_local_disk", |
||
17 | "datacenter": "ex_datacenter", |
||
18 | "keyname": "ex_keyname" |
||
19 | } |
||
20 | super(SoftlayerBaseAction, self).__init__(config=config) |
||
21 | |||
22 | def _get_driver(self): |
||
23 | cls = get_driver(Provider.SOFTLAYER) |
||
24 | return cls(self.config['username'], self.config['api_key']) |
||
25 |