diff options
author | Andy Doan <andy.doan@linaro.org> | 2015-04-08 12:27:08 -0500 |
---|---|---|
committer | Andy Doan <andy.doan@linaro.org> | 2015-04-08 12:30:27 -0500 |
commit | 14475d3ed8aeadc3d17f13ce3ef08ebd3093def3 (patch) | |
tree | 0a3d45fd301a1fa514807f988cfa533cad345901 | |
parent | 73e84ff5e06db7590d15bb2123f522c1b532463e (diff) |
link-latest requires previous operations to run
If you just do a link-latest operation, pycurl will do
GET instead of POST because it has no data to send. This fixes
the issue.
NOTE: its exposed by another bug (--dry-run is ignored by --link-latest)
Change-Id: I260b84b54ec6aaef40cfc2293573a753e447e60b
-rwxr-xr-x | linaro-cp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/linaro-cp.py b/linaro-cp.py index 698b69c..7bb04ce 100755 --- a/linaro-cp.py +++ b/linaro-cp.py @@ -135,8 +135,11 @@ class API_v2(API_v1): return self._upload_data(url, data, headers) def link_latest(self, dst): + headers = ['AuthToken: ' + self.api_key] url = self.server + '/api/v2/link_latest/' + dst - return self._upload_data(url, []) + # pycurl requires data to be passed, or it will do an + # HTTP GET even though we said to POST + return self._upload_data(url, [('foo', 'bar')], headers) def main(): |