chef/cookbooks/keystone/providers/register.rb
# Make a POST request to create a new object
Make a POST request to create a new object
Make a POST request to create a new object
def create_item(path, body, name)
  resp = session.post(path, body)
  if resp.is_a?(Net::HTTPCreated)
    Chef::Log.info("Created keystone item '#{name}'")
    return true
  elsif resp.is_a?(Net::HTTPOK)
    Chef::Log.info("Updated keystone item '#{name}'")
    return true
  else
    log_message = "Unable to create item '#{name}'"
    raise_error(resp, log_message, "create_item")
  end
end
def create_item ( path , body , name ) resp = session . post ( path , body ) if resp . is_a? ( Net :: HTTPCreated ) Chef :: Log . info ( "Created keystone item '#{name}'" ) return true elsif resp . is_a? ( Net :: HTTPOK ) Chef :: Log . info ( "Updated keystone item '#{name}'" ) return true else log_message = "Unable to create item '#{name}'" raise_error ( resp , log_message , "create_item" ) end end
Make a POST request to create a new object
Make a POST request to create a new object
path
body
name