refactor readme

This commit is contained in:
beelit94 2017-05-11 17:21:31 +08:00
parent ddc9a1ed34
commit 2213268d49

View file

@ -60,6 +60,15 @@ simply pass the string to arguments of the method, for example,
--> tf.apply(var={'a':'b', 'c':'d'}) --> tf.apply(var={'a':'b', 'c':'d'})
* if an option with None as value, it won't be used * if an option with None as value, it won't be used
#### Terraform Output
By default, stdout and stderr are captured and returned. This causes the application to appear to hang. To print terraform output in real time, provide the `capture_output` option with any value other than `None`. This will cause the output of terraform to be printed to the terminal in real time. The value of `stdout` and `stderr` below will be `None`.
from python_terraform import Terraform
t = Terraform()
return_code, stdout, stderr = t.<cmd_name>(capture_output=False)
## Examples ## Examples
### Have a test.tf file under folder "/home/test" ### Have a test.tf file under folder "/home/test"
#### 1. apply with variables a=b, c=d, refresh=false, no color in the output #### 1. apply with variables a=b, c=d, refresh=false, no color in the output
@ -98,15 +107,6 @@ In python-terraform:
tf = terraform(working_dir='/home/test') tf = terraform(working_dir='/home/test')
tf.fmt(diff=True) tf.fmt(diff=True)
# Terraform Output
By default, stdout and stderr are captured and returned. This causes the application to appear to hang. To print terraform output in real time, provide the `capture_output` option with any value other than `None`. This will cause the output of terraform to be printed to the terminal in real time. The value of `stdout` and `stderr` below will be `None`.
from python_terraform import Terraform
t = Terraform()
return_code, stdout, stderr = t.<cmd_name>(capture_output=False)
## default values ## default values
for apply/plan/destroy command, assign with following default value to make for apply/plan/destroy command, assign with following default value to make