tgwrap 0.11.6__py3-none-any.whl → 0.11.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tgwrap/cli.py +8 -8
- tgwrap/main.py +34 -1
- {tgwrap-0.11.6.dist-info → tgwrap-0.11.8.dist-info}/METADATA +1 -1
- {tgwrap-0.11.6.dist-info → tgwrap-0.11.8.dist-info}/RECORD +7 -7
- {tgwrap-0.11.6.dist-info → tgwrap-0.11.8.dist-info}/LICENSE +0 -0
- {tgwrap-0.11.6.dist-info → tgwrap-0.11.8.dist-info}/WHEEL +0 -0
- {tgwrap-0.11.6.dist-info → tgwrap-0.11.8.dist-info}/entry_points.txt +0 -0
tgwrap/cli.py
CHANGED
@@ -111,7 +111,7 @@ def main():
|
|
111
111
|
help='Run the terragrunt command with debug logging enabled (where applicable)',
|
112
112
|
show_default=True
|
113
113
|
)
|
114
|
-
@click.option('--dry-run',
|
114
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
115
115
|
help='dry-run mode, no real actions are executed (only in combination with step-by-step mode)',
|
116
116
|
show_default=True
|
117
117
|
)
|
@@ -180,7 +180,7 @@ def run(command, verbose, debug, dry_run, no_lock, update, upgrade,
|
|
180
180
|
help='Run the terragrunt command with debug logging enabled (where applicable)',
|
181
181
|
show_default=True
|
182
182
|
)
|
183
|
-
@click.option('--dry-run',
|
183
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
184
184
|
help='dry-run mode, no real actions are executed (only in combination with step-by-step mode)',
|
185
185
|
show_default=True
|
186
186
|
)
|
@@ -354,7 +354,7 @@ def show(verbose, json, working_dir, planfile_dir, terragrunt_args):
|
|
354
354
|
help='Verbose printing',
|
355
355
|
show_default=True
|
356
356
|
)
|
357
|
-
@click.option('--dry-run',
|
357
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
358
358
|
help='dry-run mode, no real actions are executed',
|
359
359
|
show_default=True
|
360
360
|
)
|
@@ -483,7 +483,7 @@ def run_analyze(verbose, exclude_external_dependencies, working_dir, start_at_st
|
|
483
483
|
help='Verbose printing',
|
484
484
|
show_default=True
|
485
485
|
)
|
486
|
-
@click.option('--dry-run',
|
486
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
487
487
|
help='dry-run mode, no real actions are executed',
|
488
488
|
show_default=True
|
489
489
|
)
|
@@ -523,7 +523,7 @@ def lock(module, auto_approve, verbose, dry_run, working_dir):
|
|
523
523
|
help='Verbose printing',
|
524
524
|
show_default=True
|
525
525
|
)
|
526
|
-
@click.option('--dry-run',
|
526
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
527
527
|
help='dry-run mode, no real actions are executed',
|
528
528
|
show_default=True
|
529
529
|
)
|
@@ -584,7 +584,7 @@ def unlock(module, auto_approve, verbose, dry_run, working_dir):
|
|
584
584
|
help='Verbose printing',
|
585
585
|
show_default=True
|
586
586
|
)
|
587
|
-
@click.option('--dry-run',
|
587
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
588
588
|
help='dry-run mode, no real actions are executed',
|
589
589
|
show_default=True
|
590
590
|
)
|
@@ -642,7 +642,7 @@ def sync(
|
|
642
642
|
help='Verbose printing',
|
643
643
|
show_default=True
|
644
644
|
)
|
645
|
-
@click.option('--dry-run',
|
645
|
+
@click.option('--dry-run', is_flag=True, default=False,
|
646
646
|
help='dry-run mode, no real actions are executed',
|
647
647
|
show_default=True
|
648
648
|
)
|
@@ -701,7 +701,7 @@ def sync_dir(
|
|
701
701
|
help='Verbose printing',
|
702
702
|
is_flag=True, default=False, show_default=True,
|
703
703
|
)
|
704
|
-
@click.option('--dry-run',
|
704
|
+
@click.option('--dry-run',
|
705
705
|
help='dry-run mode, no real actions are executed',
|
706
706
|
is_flag=True, default=False, show_default=True,
|
707
707
|
)
|
tgwrap/main.py
CHANGED
@@ -1013,6 +1013,9 @@ class TgWrap():
|
|
1013
1013
|
if terragrunt_args:
|
1014
1014
|
self.printer.verbose(f"- with additional parameters: {' '.join(terragrunt_args)}")
|
1015
1015
|
|
1016
|
+
if self.printer.print_verbose:
|
1017
|
+
self.show_tf_version(working_dir=working_dir)
|
1018
|
+
|
1016
1019
|
check_for_file=self.TERRAGRUNT_FILE
|
1017
1020
|
if working_dir:
|
1018
1021
|
check_for_file = os.path.join(working_dir, check_for_file)
|
@@ -1134,6 +1137,9 @@ class TgWrap():
|
|
1134
1137
|
if terragrunt_args:
|
1135
1138
|
self.printer.verbose(f"- with additional parameters: {' '.join(terragrunt_args)}")
|
1136
1139
|
|
1140
|
+
if self.printer.print_verbose:
|
1141
|
+
self.show_tf_version(working_dir=working_dir)
|
1142
|
+
|
1137
1143
|
# auto approve is only relevant with a modifying command
|
1138
1144
|
modifying_command = (command.lower() in ['apply', 'destroy'])
|
1139
1145
|
auto_approve = auto_approve if modifying_command else True
|
@@ -1190,7 +1196,12 @@ class TgWrap():
|
|
1190
1196
|
self.printer.verbose(rc)
|
1191
1197
|
|
1192
1198
|
# if we are planning, and analyze is requested, we need to run the analysis
|
1193
|
-
if
|
1199
|
+
if not rc: # this happens in step by step mode
|
1200
|
+
pass
|
1201
|
+
elif rc.returncode != 0:
|
1202
|
+
self.printer.error(f"An error occurred (return code {rc.returncode}) while executing command: {command.lower()}")
|
1203
|
+
self.printer.verbose(f"Executed command: {json.dumps(rc.args, indent=2)}")
|
1204
|
+
elif analyze_after_plan and command.lower() == 'plan':
|
1194
1205
|
self.printer.verbose('Analyze after plan requested')
|
1195
1206
|
self.analyze(
|
1196
1207
|
exclude_external_dependencies=exclude_external_dependencies,
|
@@ -2074,6 +2085,28 @@ Note:
|
|
2074
2085
|
self.printer.verbose(rc)
|
2075
2086
|
self.printer.normal("Cleaned the temporary files")
|
2076
2087
|
|
2088
|
+
def show_tf_version(self, working_dir):
|
2089
|
+
""" Show the terraform version """
|
2090
|
+
|
2091
|
+
cmd = 'tf --version'
|
2092
|
+
print("Show the version of terraform or tofu:")
|
2093
|
+
|
2094
|
+
rc = subprocess.run(
|
2095
|
+
cmd,
|
2096
|
+
shell=True,
|
2097
|
+
check=True,
|
2098
|
+
stdout=sys.stdout if self.printer.print_verbose else subprocess.DEVNULL,
|
2099
|
+
stderr=sys.stderr if self.printer.print_verbose else subprocess.DEVNULL,
|
2100
|
+
cwd=working_dir if working_dir else None,
|
2101
|
+
)
|
2102
|
+
self.printer.verbose(rc)
|
2103
|
+
|
2104
|
+
# check if TERRAGRUNT_TFPATH is set
|
2105
|
+
if os.environ.get('TERRAGRUNT_TFPATH'):
|
2106
|
+
self.printer.verbose(f"TERRAGRUNT_TFPATH: {os.environ.get('TERRAGRUNT_TFPATH')}")
|
2107
|
+
else:
|
2108
|
+
self.printer.verbose("TERRAGRUNT_TFPATH is not set, note that then the default will be to use terraform (instead of tofu)")
|
2109
|
+
|
2077
2110
|
def change_log(self, changelog_file, working_dir, include_nbr_of_releases):
|
2078
2111
|
""" Generate a change log """
|
2079
2112
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
tgwrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
tgwrap/analyze.py,sha256=fuET7_L8b6rlv2qnKOYXSlIv5LArvZ39CPktCeQHo7A,10285
|
3
|
-
tgwrap/cli.py,sha256=
|
3
|
+
tgwrap/cli.py,sha256=J57Kc5fScMj8__wYp8jprV8x8edOluUGsBx-arAi6kg,33503
|
4
4
|
tgwrap/deploy.py,sha256=gwFdRDzJWjkmEzZ8b0GUSrgvJeOKnpnJm1c6mM80OcY,10259
|
5
5
|
tgwrap/inspector-resources-template.yml,sha256=Mos8NDzzZ3VxdXgeiVL9cmQfRcIXIHMLf79_KLwdXu8,3297
|
6
6
|
tgwrap/inspector.py,sha256=5pW7Ex1lkKRoXY6hZGbCNmSD2iRzgMSfqi9w7gb-AcY,16990
|
7
|
-
tgwrap/main.py,sha256=
|
7
|
+
tgwrap/main.py,sha256=lEu68njHWLCiGN3l9oAO4qCrI4-2dZy6CfjEpP8dw5g,97278
|
8
8
|
tgwrap/printer.py,sha256=frn1PARd8A28mkRCYR6ybN2x0NBULhNOutn4l2U7REY,2754
|
9
|
-
tgwrap-0.11.
|
10
|
-
tgwrap-0.11.
|
11
|
-
tgwrap-0.11.
|
12
|
-
tgwrap-0.11.
|
13
|
-
tgwrap-0.11.
|
9
|
+
tgwrap-0.11.8.dist-info/LICENSE,sha256=VT-AVxIXt3EQTC-7Hy1uPGnrDNJLqfcgLgJD78fiyx4,1065
|
10
|
+
tgwrap-0.11.8.dist-info/METADATA,sha256=EjNlQYi7yVwXTsLZ9jRFPCS7pi8dXb97hT-kXSCqNfY,18355
|
11
|
+
tgwrap-0.11.8.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
12
|
+
tgwrap-0.11.8.dist-info/entry_points.txt,sha256=H8X0PMPmd4aW7Y9iyChZ0Ug6RWGXqhRUvHH-6f6Mxz0,42
|
13
|
+
tgwrap-0.11.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|