Completed
Pull Request — master (#415)
by Anthony
02:06
created

ConfigureAction.run()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 6
rs 9.4285
1
from lib.actions import BaseAction
2
import yaml
3
4
__all__ = [
5
    'ConfigureAction'
6
]
7
8
9
class ConfigureAction(BaseAction):
10
11
    def run(self, api_user, api_password):
12
        with open('/opt/stackstorm/packs/dimensiondata/config.yaml',
13
                  'w') as outfile:
14
            outfile.write(yaml.safe_dump(
15
                {"api_user": api_user,
16
                 "api_password": api_password}))
17