Update audit summary

 === Parameters
 opts[:conn](EM::Connection):: Connection used to send reply
 opts[:title](Hash):: Chef attributes hash

 === Return
 true:: Always return true
336551
def audit_update_status_command(opts)
      AuditCookStub.instance.forward_audit(:update_status, opts[:content], opts[:thread_name], opts[:options])
      CommandIO.instance.reply(opts[:conn], 'OK', close_after_writing=false)
    end
277809
function(resource, opts) {
      if (this.debugMode) log('update', { resource: resource, opts: opts })
      resource._update(this, resource, opts)
    }
1095598
def method_missing(m, *args, &block)
      if block = ChefSpec.matchers[resource_name(m.to_sym)]
        instance_exec(args.first, &block)
      else
        super
      end
    end
902586
def save_modified_attributes!(opts={})
    options = { :validate => true }.merge(opts)
    if options[:validate]
      # Complain if we aren't valid
      raise InvalidRecord, @errors.full_messages.join(", ") unless valid?
    end
    # Send the save request
    response = self.class.session.connection.set_entry(self.class._module.name, serialize_modified_attributes)
    # Complain if we don't get a parseable response back
    raise RecordsaveFailed, "Failed to save record: #{self}.  Response was not a Hash" unless response.is_a? Hash
    # Complain if we don't get a valid id back
    raise RecordSaveFailed, "Failed to save record: #{self}.  Response did not contain a valid 'id'." if response["id"].nil?
    # Save the id to the record, if it's a new record
    @attributes[:id] = response["id"] if new?
    raise InvalidRecord, "Failed to update id for: #{self}." if id.nil?
    # Clear the modified attributes Hash
    @modified_attributes = {}
    true
  end
776759
def apply_chef_config!
      super
      Chef::Config[:client_key]       = client_key
      Chef::Config[:client_name]      = 'chefspec'
      Chef::Config[:node_name]        = 'chefspec'
      Chef::Config[:solo]             = false
      Chef::Config[:solo_legacy_mode] = false

      Chef::Config[:chef_server_url]  = server.url
      Chef::Config[:http_retry_count] = 0
    end
433222
def connection
      @connection ||= ChefAPI::Connection.new do |conn|
        conn.endpoint   = ENV['STOVE_ENDPOINT']      || Config.endpoint || DEFAULT_ENDPOINT
        conn.client     = ENV['STOVE_USERNAME']      || Config.username
        conn.key        = ENV['STOVE_KEY']           || Config.key
        conn.ssl_verify = ENV['STOVE_NO_SSL_VERIFY'] || Config.ssl_verify
      end
    end
46776
def run # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
      self.config = Chef::Config.merge!(config)

      # OPTIMIZE: Maybe instead of a flag, infer the graph format from fileext?

      # Parse the configuration options, provide defaults where needed
      output_format = if config[:graphformat]
                        config[:graphformat].to_sym
                      else
                        :png
                      end
      Chef::Log.debug("Output format is: #{output_format}")

      # Determine of a filename has been passed
      filename = if @name_args.size >= 1
                   @name_args[0]
                 else
                   "role-spaghetti.#{output_format}"
                 end
      Chef::Log.debug("Output filename is: #{filename}")

      loaded_roles = loader.find_all_objects(config[:role_path])

      # If we can't find any roles, it's pointless to continue.
      if loaded_roles.empty?
        ui.fatal("No roles were found in role_path: #{config[:role_path]}")
        ui.fatal('Ensure that your knife.rb has the correct path.')
        exit 1
      end

      g = GraphViz.new(:RoleDependencies, type: :digraph,
                                          fontname: 'Verdana', fontsize: 20,
                                          label: "\n\n\nChef Role Dependencies\n",
                                          rankdir: 'LR',
                                          overlap: 'false',
                                          compound: 'true')

      loaded_roles.each do |role_file|
        # Create an absolute path, since some file references include relative paths
        abspath = File.absolute_path(File.join(config[:role_path], role_file))

        # The object_from_file method figures out the ruby/json logic
        role = loader.object_from_file(abspath)

        Chef::Log.debug("Loaded role is: #{role}")

        # OPTIMIZE: Handle environment run_lists

        g.node[:shape] = 'box'
        g.node[:style] = 'rounded'
        g.node[:color] = 'red'
        role_node = g.add_nodes("#{role.name}_role", label: role.name)

        # This logic is to ensure that an embedded role doesn't change color
        role.run_list.each do |rli|
          if rli.role?
            g.node[:shape] = 'box'
            g.node[:style] = 'rounded'
            g.node[:color] = 'red'
            rli_node = g.add_nodes("#{rli.name}_role", label: rli.name)
          else
            g.node[:shape] = 'component'
            g.node[:color] = 'blue'
            rli_node = g.add_nodes(rli.name)
          end

          g.add_edges(role_node, rli_node)
        end
      end

      # Let's write out the graph to a file
      if config[:neatograph]
        g.output(output_format => filename.to_s, :use => 'neato')
      else
        # default to dot
        g.output(output_format => filename.to_s)
      end

      ui.msg("A Role dependency graph has been written to #{filename}")
    end
815183
def update_cookbook_path
      # both cookbook sequences and paths are listed in same order as
      # presented in repo UI. previous to RL v5.7 we received cookbook sequences
      # in an arbitrary order, but this has been fixed as of the release of v5.8
      # (we will not change the order for v5.7-).
      # for chef to execute repos and paths in the order listed, both of these
      # ordered lists need to be inserted in reverse order because the chef code
      # replaces cookbook paths as it reads the array from beginning to end.
      @cookbooks.reverse.each do |cookbook_sequence|
        local_basedir = File.join(@download_path, cookbook_sequence.hash)
        cookbook_sequence.paths.reverse.each do |path|
          dir = File.expand_path(File.join(local_basedir, path))
          unless Chef::Config[:cookbook_path].include?(dir)
            if File.directory?(dir)
              Chef::Config[:cookbook_path] << dir
            else
              RightScale::Log.info("Excluding #{path} from chef cookbooks_path because it was not downloaded")
            end
          end
        end
      end
      RightScale::Log.info("Updated cookbook_path to: #{Chef::Config[:cookbook_path].join(", ")}")
      true
    end
440100
def update
      return false if new_record?
      run_callbacks :save do
        run_callbacks :update do
          httparty = self.class.put(self[:@url], request_options.merge(:body => to_json))
          handle_save_response(httparty)
        end
      end
    end
552003
def connection_options(opts)
      connection_options = {
        logger:                 logger,
        user_known_hosts_file:  '/dev/null',
        hostname:               opts[:host],
        port:                   opts[:port],
        username:               opts[:user],
        compression:            opts[:compression],
        compression_level:      opts[:compression_level],
        keepalive:              opts[:keepalive],
        keepalive_interval:     opts[:keepalive_interval],
        timeout:                opts[:connection_timeout],
        connection_retries:     opts[:connection_retries],
        connection_retry_sleep: opts[:connection_retry_sleep],
        max_wait_until_ready:   opts[:max_wait_until_ready],
        auth_methods:           opts[:auth_methods],
        keys_only:              opts[:keys_only],
        keys:                   opts[:key_files],
        password:               opts[:password],
        forward_agent:          opts[:forward_agent],
        proxy_command:          opts[:proxy_command],
        bastion_host:           opts[:bastion_host],
        bastion_user:           opts[:bastion_user],
        bastion_port:           opts[:bastion_port],
        non_interactive:        opts[:non_interactive],
        transport_options:      opts,
      }
      # disable host key verification. The hash key and value to use
      # depends on the version of net-ssh in use.
      connection_options[verify_host_key_option] = verify_host_key_value(opts[:verify_host_key])

      connection_options
    end
696686
def https_app
      ssl_options  = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:options]
      ssl_options |= OpenSSL::SSL::OP_CIPHER_SERVER_PREFERENCE if defined?(OpenSSL::SSL::OP_CIPHER_SERVER_PREFERENCE)
      # This is required to disable SSLv3 on Ruby 1.8.7
      ssl_options |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
      ssl_options |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
      ssl_options |= OpenSSL::SSL::OP_NO_TLSv1 if defined?(OpenSSL::SSL::OP_NO_TLSv1)

      if Settings.instance.tls_disabled_versions
        Settings.instance.tls_disabled_versions.each do |version|
          constant = OpenSSL::SSL.const_get("OP_NO_TLSv#{version.to_s.tr('.', '_')}") rescue nil

          if constant
            Log.instance.info "TLSv#{version} will be disabled."
            ssl_options |= constant
          else
            Log.instance.warn "TLSv#{version} was not found."
          end
        end
      end

      {
        :SSLEnable => true,
        :SSLVerifyClient => OpenSSL::SSL::VERIFY_PEER,
        :SSLPrivateKey => ssl_private_key,
        :SSLCertificate => ssl_certificate,
        :SSLCACertificateFile => Settings.instance.ssl_ca_file,
        :SSLOptions => ssl_options
      }
    end
1124388
def cookbook_statement(cookbook_name, metadata=None):
        """"""
        line = "cookbook '%s'" % cookbook_name
        if metadata:
            if not isinstance(metadata, dict):
                raise TypeError("Berksfile dependency hash for %s "
                                "should be a dict of options, not %s."
                                % (cookbook_name, metadata))
            # not like the others...
            if 'constraint' in metadata:
                line += ", '%s'" % metadata.pop('constraint')
            for opt, spec in metadata.items():
                line += ", %s: '%s'" % (opt, spec)
        return line
559694
function (conn, opts) {
            opts = opts || {};
            var s = opts.prepare;
            var logConnectionExecute = comb("__logConnectionExecute");
            if (s) {
                s = this.literal(s);
                var self = this;
                return this.__logConnectionExecute(conn, "XA END " + s)
                    .chain(function () {
                        return self.__logConnectionExecute(conn, "XA PREPARE " + s);
                    })
                    .chain(function () {
                        return self.__logConnectionExecute(conn, "XA ROLLBACK " + s);
                    });
            } else {
                return this._super(arguments);
            }
        }
92143
def _monkey_patch_old_chef!
      require 'chef/event_dispatch/dispatcher'
      instance = self
      orig_method = Chef::EventDispatch::Dispatcher.instance_method(:library_file_loaded)
      Chef::EventDispatch::Dispatcher.send(:define_method, :library_file_loaded) do |filename|
        instance.events = self
        instance.monkey_patched = false
        @subscribers |= [instance]
        Chef::EventDispatch::Dispatcher.send(:define_method, :library_file_loaded, orig_method)
        orig_method.bind(self).call(filename)
      end
    end
129097
def summary
      if update_type == :message
        message
      elsif update_type == :recv and @data[2,9] == "+++++++++"
        "creating local"
      elsif update_type == :recv
        "updating local"
      elsif update_type == :sent and @data[2,9] == "+++++++++"
        "creating remote"
      elsif update_type == :sent
        "updating remote"
      else
        changes = []
        [:checksum, :size, :timestamp, :permissions, :owner, :group, :acl].each do |prop|
          changes << prop if send(prop) == :changed
        end
        changes.join(", ")
      end
    end
361771
def update(cls, spec, updates, upsert=False):
        '''
        
        '''
        if 'key' in spec:
            previous = cls.get(spec['key'])
        else:
            previous = None
        if previous:
            # Update existing data.
            current = cls(**previous.__dict__)
        elif upsert:
            # Create new data.
            current = cls(**spec)
        else:
            current = None
        # XXX Should there be any error thrown if this is a noop?
        if current:
            current.__dict__.update(updates)
            current.save()
        return current
778233
def update(self, name=None, algorithm=None, protocol=None, halfClosed=None,
            port=None, timeout=None, httpsRedirect=None):
        
        return self.manager.update(self, name=name, algorithm=algorithm,
                protocol=protocol, halfClosed=halfClosed, port=port,
                timeout=timeout, httpsRedirect=httpsRedirect)