图书馆员木偶 - 未定义的方法`map' for nil:NilClass(默认值:NoMethodError)

时间:2015-10-02 09:31:20

标签: vagrant puppet librarian-puppet

虽然使用Vagrant librarian-puppet来自arpitaggarwal/tomcatPuppetfile模块的forge "http://forge.puppetlabs.com" mod "puppetlabs/apt" mod 'tomcat', :git => 'https://github.com/arpitaggarwal/tomcat.git' 模块适用于我PuppetFile内容如下:

Puppetfile

forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"

并且,当我将 ==> default: /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:29:in `versions' ==> default: : ==> default: undefined method `map' for nil:NilClass ==> default: ( ==> default: NoMethodError ==> default: ) ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:43:in `manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:312:in `manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `map' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:117:in `cache_manifests!' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:113:in `manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:70:in `recursive_resolve' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:154:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:187:in `scope_checking_manifest' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:186:in `scope_checking_manifest' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:153:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:211:in `map_find' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `each' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `map_find' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:50:in `resolve' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver.rb:23:in `resolve' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/action/resolve.rb:26:in `run' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:169:in `resolve!' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/cli.rb:69:in `install' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `__send__' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `run' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/base.rb:440:in `start' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!' ==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/bin/librarian-puppet:7 ==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19:in `load' ==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19 内容编辑为:

#!/usr/bin/env python
from datetime import datetime
from email.utils import parsedate_tz, mktime_tz

timestamp = mktime_tz(parsedate_tz("Thu, 01 Oct 2015 00:02:01 +0200"))
print(datetime.fromtimestamp(timestamp)) # get local time

我收到了一个错误:

datetime.fromtimestamp()

我知道如何解决它?

1 个答案:

答案 0 :(得分:1)

您能否详细说明如何安装librarian-puppet

我有一个安装它的脚本(基于this one),它可以安装好以下

舱单/ init.pp

class { 'tomcat':  }

Puppetfile

forge "http://forge.puppetlabs.com"

mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"

vagrant up

的输出
==> default: Running provisioner: puppet...
==> default: Running Puppet with main.pp...
==> default: stdin: is not a tty
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
==> default: Notice: /Stage[main]/Tomcat/Exec[apt-update]/returns: executed successfully
==> default: Notice: /Stage[main]/Tomcat/Package[tomcat7]/ensure: ensure changed 'purged' to 'present'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/default/tomcat7]/content: content changed '{md5}49f3fe5de425aca649e2b69f4495abd2' to '{md5}2694682a4593e8d185d428f6bdeb39e2'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/tomcat7/server.xml]/content: content changed '{md5}523967040584a921450af2265902568d' to '{md5}676faee02c60f2e593530339cadf4791'
==> default: Notice: /Stage[main]/Tomcat/Exec[service-restart]/returns: executed successfully
==> default: Notice: Finished catalog run in 389.24 seconds

已安装Tomcat并在VM上

vagrant@precise64:~$ librarian-puppet version
librarian-puppet v1.5.0
vagrant@precise64:~$

上一个答案 我认为在较新版本的图书管理员中,您需要使用forge "https://forgeapi.puppetlabs.com"