sync: fix os.environ logic errors

This is a dict to index, not a function to call.

Change-Id: I0117eeaaa8b2ef4762ab6f0d22f9ffdaee961f52
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258132
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
This commit is contained in:
Mike Frysinger 2020-03-07 01:53:53 -05:00 committed by David Pursehouse
parent 910dfe8497
commit e20da3eeed

View File

@ -729,12 +729,12 @@ later is required to fix a server side protocol bug.
branch = branch[len(R_HEADS):] branch = branch[len(R_HEADS):]
if 'SYNC_TARGET' in os.environ: if 'SYNC_TARGET' in os.environ:
target = os.environ('SYNC_TARGET') target = os.environ['SYNC_TARGET']
[success, manifest_str] = server.GetApprovedManifest(branch, target) [success, manifest_str] = server.GetApprovedManifest(branch, target)
elif ('TARGET_PRODUCT' in os.environ and elif ('TARGET_PRODUCT' in os.environ and
'TARGET_BUILD_VARIANT' in os.environ): 'TARGET_BUILD_VARIANT' in os.environ):
target = '%s-%s' % (os.environ('TARGET_PRODUCT'), target = '%s-%s' % (os.environ['TARGET_PRODUCT'],
os.environ('TARGET_BUILD_VARIANT')) os.environ['TARGET_BUILD_VARIANT'])
[success, manifest_str] = server.GetApprovedManifest(branch, target) [success, manifest_str] = server.GetApprovedManifest(branch, target)
else: else:
[success, manifest_str] = server.GetApprovedManifest(branch) [success, manifest_str] = server.GetApprovedManifest(branch)