Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_member
- if @property_flush[:ensure] == :absent
- # a shard can't be removed easily at this time
- return
- end
- return if @property_flush[:ensure] == :present && @property_hash[:ensure] != :present
- Puppet.debug "Adding the shard #{name}"
- output = sh_addshard(@property_flush[:member])
- raise Puppet::Error, "sh.addShard() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
- output = sh_enablesharding(name)
- raise Puppet::Error, "sh.enableSharding() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
- if @property_flush[:keys]
- @property_flush[:keys].each do |key|
- output = sh_shardcollection(key)
- raise Puppet::Error, "sh.shardCollection() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
- end
- end
- end
Add Comment
Please, Sign In to add comment