    # File lib/fog/openstack/requests/compute/create_key_pair.rb, line 6
            def create_key_pair(key_name, public_key = nil)

              data = {
                'keypair' => {
                  'name' => key_name
                }
              }

              data['keypair']['public_key'] = public_key unless public_key.nil?

              request(
                :body     => MultiJson.encode(data),
                :expects  => 200,
                :method   => 'POST',
                :path     => 'os-keypairs.json'
              )
            end