wrapper: normalize dashes to underscores
This will allow us to have `cros-workon` as a program with the
underlying module still names "cros_workon.py". The wrapper
today already supports "cros-workon.py", but we don't want to
rename modules, or use dashes in them in general as it makes
it a lot harder to import.
BUG=b:187792699
TEST=`cros-workon --help` passes
Change-Id: I3f2aaae1ea89534cd2db32305b216f513f35b96c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2975662
Reviewed-by: Alex Klein <saklein@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/wrapper3.py b/scripts/wrapper3.py
index 9b5f7ac..39aba5f 100755
--- a/scripts/wrapper3.py
+++ b/scripts/wrapper3.py
@@ -147,7 +147,7 @@
'\tparent: %s\n'
'\tCHROMITE_PATH: %s' % (parent, CHROMITE_PATH))
parent = parent[len(CHROMITE_PATH):].split(os.sep)
- target = ['chromite'] + parent + [target]
+ target = ['chromite'] + parent + [target.replace('-', '_')]
if target[1] == 'bin':
# Convert chromite/bin/foo -> chromite/scripts/foo.