delete temporary files

Change-Id: Iabf18e39b07878ea3f366e35ef77d8130b602a66
This commit is contained in:
Igor Gajsin 2016-07-25 16:08:43 +03:00
parent a8dcead81e
commit 6ba724d518
3 changed files with 0 additions and 44 deletions

View File

@ -1,3 +0,0 @@
notify {'MODULAR: manila/override_hiera'}
override_hiera('/etc/hiera/plugins/fuel-plugin-manila.yaml')

View File

@ -1,39 +0,0 @@
module Puppet::Parser::Functions
newfunction(:populate_hiera, :type => :rvalue,
:doc => <<-EOS
Add plugin specific data to hiera.
EOS
) do |args|
raise(Puppet::ParseError, 'No file name provided!') if args.size < 3 or args[0] == ""
require 'yaml'
require 'fileutils'
file=args[0]
key=args[1]
value=args[2]
data = YAML::load_file(file) || {"manila" => {}}
dir=File.dirname(file)
# read data
if File.exists?(file)
old_data = YAML::load_file(file) || {}
new_data = Hash.new{|h,k| h[k]=Hash.new(&h.default_proc) }.merge(old_data)
else
new_data = Hash.new{|h,k| h[k]=Hash.new(&h.default_proc) }
end
# modify data
md = new_data["neutron_config"]["L2"]["mechanism_drivers"]
if not md or md == {}
md = "openvswitch,l2population,vmware_dvs"
else
if not md.include?('vmware_dvs')
md << ',vmware_dvs'
end
end
new_data["neutron_config"]["L2"]["mechanism_drivers"] = md
# write data
unless File.directory?(dir)
FileUtils.mkdir_p(dir)
end
File.open(file, 'w') {|f| f.write new_data.to_yaml}
end
end

View File

@ -1,2 +0,0 @@
1. openstack user create manila --password manila
done