1. update README

This commit is contained in:
Freddy Tan 2016-11-19 18:25:35 +08:00
parent bd1d08af71
commit 8a522295f1

View file

@ -13,21 +13,21 @@ python-terraform is a python module provide a wrapper of `terraform` command lin
For any terraform command For any terraform command
def cmd(self, cmd, *args, **kwargs): def cmd(self, cmd, *args, **kwargs):
""" """
run a terraform command, if success, will try to read state file run a terraform command, if success, will try to read state file
:param cmd: command and sub-command of terraform, seperated with space :param cmd: command and sub-command of terraform, seperated with space
refer to https://www.terraform.io/docs/commands/index.html refer to https://www.terraform.io/docs/commands/index.html
:param args: arguments of a command :param args: arguments of a command
:param kwargs: any option flag with key value without prefixed dash character :param kwargs: any option flag with key value without prefixed dash character
if there's a dash in the option name, use under line instead of dash, if there's a dash in the option name, use under line instead of dash,
ex. -no-color --> no_color ex. -no-color --> no_color
if it's a simple flag with no value, value should be IsFlagged if it's a simple flag with no value, value should be IsFlagged
ex. cmd('taint', allow_missing=IsFlagged) ex. cmd('taint', allow_missing=IsFlagged)
if it's a boolean value flag, assign True or false if it's a boolean value flag, assign True or false
if it's a flag could be used multiple times, assign list to it's value if it's a flag could be used multiple times, assign list to it's value
if it's a "var" variable flag, assign dictionary to it if it's a "var" variable flag, assign dictionary to it
if a value is None, will skip this option if a value is None, will skip this option
:return: ret_code, out, err :return: ret_code, out, err
For apply/destroy method, the flag options, like, `-no-color` or `-force` For apply/destroy method, the flag options, like, `-no-color` or `-force`
have been implemented as boolean argument. simply use `is_no_color=True/False` for have been implemented as boolean argument. simply use `is_no_color=True/False` for