我正在构建一个自定义类型,我无法从defaultto块访问hiera范围
module Puppet
require 'puppet/parser/functions/hiera'
newtype(:my_type) do
ensurable
newparam(:myparam) do
defaultto { Puppet::Parser::Functions.hiera('myparam') }
end
newproperty(:value) do
desc "Value of the item."
end
end
end
Run Code Online (Sandbox Code Playgroud)
但我明白了
Error: undefined method `hiera' for Puppet::Parser::Functions:Module
Run Code Online (Sandbox Code Playgroud)
我实际上正在使用Puppet 3.8和未来的解析器
作为一种解决方法,我们使用
$my_vals = hiera_hash('mytype_vals')
create_resource(my_type, $myvals, {myparam => hiera('myparam')})
Run Code Online (Sandbox Code Playgroud)
这样可以正常工作,但是my_type
期望在目录中的任何地方实例化对象,并且预期myparam
所有实例中的对象都是相同的.因此,不需要多个默认值声明.
另一种方法是放置
My_type{
myparam => hiera('myparam')
}
Run Code Online (Sandbox Code Playgroud)
在节点清单中.这也可以解决问题,但我们正在开发一个模块,主要清单超出了我们的范围
git和github的新功能.
我想在本地和远程替换master
我的其他分支的git 分支bridge
.问题是git无法解析bridge
分支的引用.问题来自推向github.
git树是如何形成的:
为了规避,我创建了另一个名为bridge的分支.我不喜欢我已将网桥设为默认设置,因此我尝试将其更改为主设备使用:
git checkout better_branch git merge --strategy=ours master # keep the content of this branch, but record a merge git checkout master git merge better_branch # fast-forward master up to the merge
它在当地工作.但是,当我试图推动时,我得到以下内容:
NAME@**** /C/Users/NAME/Documents/GitHub/tabtrack (master) $ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the …