Created
January 23, 2020 19:10
-
-
Save zdw/e2e6cd42aaf100bf57430ee1bde3a0d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lf/global-jjb/shell $ git review | |
remote: error: branch refs/publish/master/jobcosterrorhandling: | |
remote: You need 'Create' rights to create new references. | |
remote: User: zdw | |
remote: Contact an administrator to fix the permissions | |
remote: Processing changes: refs: 1, done | |
To ssh://gerrit.linuxfoundation.org:29418/releng/global-jjb.git | |
! [remote rejected] HEAD -> refs/publish/master/jobcosterrorhandling (prohibited by Gerrit: not permitted: create) | |
error: failed to push some refs to 'ssh://[email protected]:29418/releng/global-jjb.git' |
Same error with bare git commands (not review):
lf/global-jjb/shell $ git branch -v
* jobcosterrorhandling ad24ed5 Error handling for AWS in job-cost.sh
master 93980c8 DO NOT create a virtualenv in ~/.local
lf/global-jjb/shell $ git push gerrit HEAD:refs/publish/master
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 665 bytes | 665.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3)
remote: error: branch refs/publish/master:
remote: You need 'Create' rights to create new references.
remote: User: zdw
remote: Contact an administrator to fix the permissions
remote: Processing changes: refs: 1, done
To ssh://gerrit.linuxfoundation.org:29418/releng/global-jjb.git
! [remote rejected] HEAD -> refs/publish/master (prohibited by Gerrit: not permitted: create)
error: failed to push some refs to 'ssh://[email protected]:29418/releng/global-jjb.git'
The actual change is minor:
lf/global-jjb/shell $ git diff gerrit/master
diff --git a/shell/job-cost.sh b/shell/job-cost.sh
index 5bd61be..9cbc716 100644
--- a/shell/job-cost.sh
+++ b/shell/job-cost.sh
@@ -8,7 +8,7 @@
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
-echo "---> build-cost.sh"
+echo "---> job-cost.sh"
set -euf -o pipefail
@@ -49,8 +49,16 @@ echo "INFO: Retrieving Pricing Info for: $instance_type"
url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime"
json_block=$(curl -s "$url")
-cost=$(jq .cost <<< "$json_block")
-resource=$(jq .resource <<< "$json_block" | tr -d '"')
+if jq <<< "$json_block"
+then
+ cost=$(jq .cost <<< "$json_block")
+ resource=$(jq .resource <<< "$json_block" | tr -d '"')
+else
+ echo "ERROR: EC2 pricing returned invalid json"
+ cost=0
+ resource=0
+fi
+
# Archive the cost date
mkdir -p "$WORKSPACE/archives/cost"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My commit looks like: