fog openstack 401 验证失败

验证失败,是因为我的api_key写的不对???

size=30 
OpenStack.volumes.create(size: size, name: 'test', description: 'test') 
[fog][WARNING] OpenStack[:compute] is not recommended, use Compute[:openstack]
 for portability
Excon::Errors::Unauthorized: Expected([200, 204]) <=> Actual(401 Unauthorized)

excon.error.response
  :body          => "{\"error\": {\"message\": \"The request you have made req
uires authentication.\", \"code\": 401, \"title\": \"Unauthorized\"}}"
  :headers       => {
    "Content-Length"   => "114"
    "Content-Type"     => "application/json"
    "Date"             => "Wed, 03 Dec 2014 12:32:29 GMT"
    "Vary"             => "X-Auth-Token"
    "Www-Authenticate" => "Keystone uri=\"http://114.212.189.147:5000\""
    "X-Distribution"   => "Ubuntu"
  }
  :local_address => "192.168.100.2"
  :local_port    => 49313
  :reason_phrase => "Unauthorized"
  :remote_ip     => "114.212.189.147"
  :status        => 401

 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/excon-0.42.0/lib/excon/middlewa
res/expects.rb:10:in `response_call'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/excon-0.42.0/lib/excon/middlewa
res/response_parser.rb:8:in `response_call'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/excon-0.42.0/lib/excon/connecti
on.rb:365:in `response'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/excon-0.42.0/lib/excon/connecti
on.rb:235:in `request'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-core-1.25.0/lib/fog/core/co
nnection.rb:63:in `request'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/openstack/co
re.rb:202:in `retrieve_tokens_v2'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/openstack/co
re.rb:97:in `authenticate_v2'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/openstack/co
mpute.rb:395:in `authenticate'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/openstack/co
mpute.rb:320:in `initialize'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-core-1.25.0/lib/fog/core/se
rvice.rb:115:in `new'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-core-1.25.0/lib/fog/core/se
rvice.rb:115:in `new'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-core-1.25.0/lib/fog/compute
.rb:56:in `new'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/bin/openstac
k.rb:31:in `block in []'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/bin/openstac
k.rb:57:in `yield'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/bin/openstac
k.rb:57:in `default'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/bin/openstac
k.rb:57:in `[]'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/lib/fog/bin.rb:39:in
 `volumes'
 from (irb):2:in `<top (required)>'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/bin/fog:76:in `block
 in <top (required)>'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/bin/fog:76:in `catch
'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/gems/fog-1.25.0/bin/fog:76:in `<top 
(required)>'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/bin/fog:23:in `load'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/bin/fog:23:in `<main>'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `eva
l'
 from /home/nju/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `<ma
in>'>>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值