Guest User

Untitled

a guest
Oct 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. def set_member
  2. if @property_flush[:ensure] == :absent
  3. # a shard can't be removed easily at this time
  4. return
  5. end
  6.  
  7. return if @property_flush[:ensure] == :present && @property_hash[:ensure] != :present
  8.  
  9. Puppet.debug "Adding the shard #{name}"
  10. output = sh_addshard(@property_flush[:member])
  11. raise Puppet::Error, "sh.addShard() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
  12. output = sh_enablesharding(name)
  13. raise Puppet::Error, "sh.enableSharding() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
  14. if @property_flush[:keys]
  15. @property_flush[:keys].each do |key|
  16. output = sh_shardcollection(key)
  17. raise Puppet::Error, "sh.shardCollection() failed for shard #{name}: #{output['errmsg']}" if output['ok'].zero?
  18. end
  19. end
  20. end
Add Comment
Please, Sign In to add comment