def check_chef_env(chef_env_name)
      return unless chef_env_name
      Chef::Environment.load(chef_env_name) if chef_env_name
    rescue Net::HTTPServerException => e
      raise unless e.to_s =~ /^404/
      ui.info 'Creating chef environment ' + chef_env_name
      chef_env = Chef::Environment.new
      chef_env.name(chef_env_name)
      chef_env.create
      chef_env
    end
def check_chef_env(chef_env_name)
      return unless chef_env_name
      Chef::Environment.load(chef_env_name) if chef_env_name
    rescue Net::HTTPServerException => e
      raise unless e.to_s =~ /^404/
      ui.info 'Creating chef environment ' + chef_env_name
      chef_env = Chef::Environment.new
      chef_env.name(chef_env_name)
      chef_env.create
      chef_env
    end
make sure the chef environment exists