Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdc-listmachines --acount not working w/o --credentials true #13

Open
Licenser opened this issue Apr 16, 2012 · 3 comments
Open

sdc-listmachines --acount not working w/o --credentials true #13

Licenser opened this issue Apr 16, 2012 · 3 comments

Comments

@Licenser
Copy link
Contributor

When passing --acount the key ID is wrong. look at:

  • keyId="/--credentials/keys/id_rsa"
  • GET /--credentials/machines?name=--tag

if you applie --credentials true it works so either --account should implie --credentials or be discared if --credentials is false

schroedinger:Projects licenser$ sdc-listmachines --debug true --acount admin
2012-04-16 07:36:32Z DEBUG: No ssh-agent identities found
2012-04-16 07:36:32Z DEBUG: Using private key from: /Users/licenser/.ssh/id_rsa
2012-04-16 07:36:32Z TRACE: RestClient: constructed { _log: [Function],
  url: 
   { protocol: 'http:',
     slashes: true,
     host: '172.16.0.4',
     hostname: '172.16.0.4',
     href: 'http://172.16.0.4/',
     pathname: '/',
     path: '/' },
  proto: 
   { parsers: [Object],
     STATUS_CODES: [Object],
     IncomingMessage: [Object],
     OutgoingMessage: [Object],
     ServerResponse: [Object],
     Agent: [Object],
     globalAgent: [Object],
     ClientRequest: [Object],
     request: [Function],
     get: [Function],
     Server: [Object],
     createServer: [Function],
     _connectionListener: [Function: connectionListener],
     Client: [Object],
     createClient: [Function] },
  path: '',
  headers: { Accept: 'application/json', 'x-api-version': '~6.5' },
  retryOptions: { retries: 3, minTimeout: 500 },
  retryCallback: [Function: checkFor500],
  contentType: 'application/json',
  noContentMD5: undefined }
2012-04-16 07:36:32Z TRACE: RestClient: _processArguments => { options: 
   { contentType: 'application/json',
     headers: 
      { 'x-api-version': '~6.5',
        Accept: 'application/json',
        Authorization: 'Signature keyId="/--credentials/keys/id_rsa",algorithm="rsa-sha256" itw33gmarbaJWHz1Za2tbYw5mRfoUCWchBykkplQKbrb+X1tFW22yPUN9prxW/8EOBOriTubeN1MLfU7JEc0TAXvetxWQt5uiVIIiU4xmcVyLu9/7MZ/ql5liZSaZwly2EcwldBiicw4cb2iUSj/8aW6ZziEXfsB/xmiNTiF8olcPxyL6xXLX0SmLaK+WTiE7WNNgSBShrD6AMts4/M38+xl/QaIqYz4Qu+nzCUHn9U91OC/2yTxR3PMIk5HREMlXttlvy6AMhhbvExkKOrqss94L6AmJSBUl9ZZzO5cPUU1tCWAnN1R0befx82rtm0mGZ3S6lcN5CL5OEXm8U/pcQ==',
        Date: 'Mon, 16 Apr 2012 07:36:32 GMT' },
     method: 'GET',
     path: '/--credentials/machines?name=--tag',
     host: '172.16.0.4',
     port: '80',
     query: { name: '--tag' },
     expect: [ 200 ] },
  callback: [Function] }
2012-04-16 07:36:32Z TRACE: RestClient(86a1d25, attempt=1): issuing request { contentType: 'application/json',
  headers: 
   { 'x-api-version': '~6.5',
     Accept: 'application/json',
     Authorization: 'Signature keyId="/--credentials/keys/id_rsa",algorithm="rsa-sha256" itw33gmarbaJWHz1Za2tbYw5mRfoUCWchBykkplQKbrb+X1tFW22yPUN9prxW/8EOBOriTubeN1MLfU7JEc0TAXvetxWQt5uiVIIiU4xmcVyLu9/7MZ/ql5liZSaZwly2EcwldBiicw4cb2iUSj/8aW6ZziEXfsB/xmiNTiF8olcPxyL6xXLX0SmLaK+WTiE7WNNgSBShrD6AMts4/M38+xl/QaIqYz4Qu+nzCUHn9U91OC/2yTxR3PMIk5HREMlXttlvy6AMhhbvExkKOrqss94L6AmJSBUl9ZZzO5cPUU1tCWAnN1R0befx82rtm0mGZ3S6lcN5CL5OEXm8U/pcQ==',
     Date: 'Mon, 16 Apr 2012 07:36:32 GMT',
     'content-length': 0 },
  method: 'GET',
  path: '/--credentials/machines?name=--tag',
  host: '172.16.0.4',
  port: '80',
  query: { name: '--tag' },
  expect: [ 200 ] }
2012-04-16 07:36:33Z TRACE: RestClient(86a1d25): GET /--credentials/machines?name=--tag => code=401, headers={ 'content-type': 'application/json',
  connection: 'keep-alive',
  'transfer-encoding': 'chunked' }
2012-04-16 07:36:33Z TRACE: RestClient(86a1d25): GET /--credentials/machines?name=--tag => body={"error":"key not found"}
2012-04-16 07:36:33Z TRACE: RestClient: GET /--credentials/machines?name=--tag: issuing callback
@mcavage
Copy link
Contributor

mcavage commented Apr 16, 2012

Nice :)

Ok, I'll add this to the fix list in here with the other one you reported.

@Licenser
Copy link
Contributor Author

Okay some more debugging and it seems that the problem was caused by misspelling --account with --acount - I have no clue what caused this to give the error above

@Licenser
Copy link
Contributor Author

I tracked this to a nopt bug and filed a report: npm/nopt#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants