This makes sure that:
 All supervisors have a status that is a hash
 If it has something else for whatever reason, the real object is put in a hash under the 'status' key
2645
def normalize_status_data!
      self.status ||= {}      
      self.status['workers'] ||= {}
      
      self.status['workers'].each do |k,v|
        unless v.is_a?(Hash)
          v = {'state' => v.inspect }
        end
      end
      
      self.databag ||= {}
      self.databag['workers'] ||= {}
    end
675898
def ensure_board
      board_id = params[:board_id] || params[:id]
      result = has_board_access(board_id)
      @board = result[:board]
      @user_board = result[:user_board]
      head result[:status] if result[:status] != :ok
    end
422584
def check_hash_for_conflicts(hash)
      raise HashArgumentError, 'It must be a hash' unless hash.is_a?(Hash)

      unless (conflicts = self.public_methods & hash.keys.map(&:to_sym)).empty?
        raise HashArgumentError, "Rename keys in order to avoid conflicts with internal calls: #{conflicts.join(', ')}"
      end
    end
713791
def make_snapshot_from_ops_hash( cls, record_root_hash, prev_consensus_hashes ):
        
        # mix into previous consensus hashes...
        all_hashes = prev_consensus_hashes[:] + [record_root_hash]
        all_hashes.sort()
        all_hashes_merkle_tree = MerkleTree( all_hashes )
        root_hash = all_hashes_merkle_tree.root()

        consensus_hash = StateEngine.calculate_consensus_hash( root_hash )
        return consensus_hash
748621
def has_serialized(name, &block)
      serialize name, Hash

      initializer = Serializer::Initializer.new
      block.call(initializer)

      initializer.each do |method, options|

        define_method "#{method}" do
          hash = send(name)
          result = hash[method.to_sym] if hash

          if hash.nil? or result.nil?
            send("#{name}=", {}) unless send(name)
            hash = send(name)

            result = options[:default]
            result = result.clone if result.duplicable?

            hash[method.to_sym] = result
          end

          return result
        end

        define_method "#{method}?" do
          hash = send(name)
          result = hash[method.to_sym] if hash

          if hash.nil? or result.nil?
            send("#{name}=", {}) unless send(name)
            hash = send(name)

            result = options[:default]
            result = result.clone if result.duplicable?

            hash[method.to_sym] = result
          end

          return result
        end

        define_method "#{method}=" do |value|
          original = send(name) || {}

          if options[:type] and value
            case options[:type].to_sym
            when :float   then value = value.to_f if value.respond_to? :to_f
            when :integer then value = value.to_i if value.respond_to? :to_i
            when :string  then value = value.to_str if value.respond_to? :to_str
            when :symbol  then value = value.to_sym if value.respond_to? :to_sym
            when :boolean then
              value = true  if value.eql? "true"
              value = false if value.eql? "false"
              value = !value.to_i.zero? if value.respond_to? :to_i
            end
          end

          modified = original.clone
          modified[method.to_sym] = value

          send("#{name}_will_change!") unless modified.eql?(original)
          send("#{name}=", modified)
        end

      end
    end
350789
def _handle_status(self, key, value):
        
        if key in (
                "USERID_HINT",
                "NEED_PASSPHRASE",
                "BAD_PASSPHRASE",
                "GOOD_PASSPHRASE",
                "MISSING_PASSPHRASE",
                "PINENTRY_LAUNCHED",
                "BEGIN_SIGNING",
                "CARDCTRL",
                "INV_SGNR",
                "SIGEXPIRED",
                "KEY_CONSIDERED",
            ):
            self.status = key.replace("_", " ").lower()
        elif key == "SIG_CREATED":
            (self.sig_type, self.sig_algo, self.sig_hash_algo,
             self.what, self.timestamp, self.fingerprint) = value.split()
        elif key == "KEYEXPIRED":
            self.status = "skipped signing key, key expired"
            if (value is not None) and (len(value) > 0):
                 self.status += " on {}".format(str(value))
        elif key == "KEYREVOKED":
            self.status = "skipped signing key, key revoked"
            if (value is not None) and (len(value) > 0):
                 self.status += " on {}".format(str(value))
        elif key == "NODATA":
            self.status = nodata(value)
        elif key == "PROGRESS":
            self.status = progress(value.split(' ', 1)[0])
        else:
            raise ValueError("Unknown status message: %r" % key)
894700
def has_key?(key)
      if :hash == self.type
        self.children.any? { |pair_node| pair_node.key.to_value == key }
      else
        raise Synvert::Core::MethodNotSupported.new "has_key? is not handled for #{self.debug_info}"
      end
    end
250353
def hash_value(key)
      if :hash == self.type
        value_node = self.children.find { |pair_node| pair_node.key.to_value == key }
        value_node ? value_node.value : nil
      else
        raise Synvert::Core::MethodNotSupported.new "has_key? is not handled for #{self.debug_info}"
      end
    end
850980
def rev_priv_hierarchy
      if @rev_priv_hierarchy.nil?
        @rev_priv_hierarchy = {}
        privilege_hierarchy.each do |key, value|
          value.each do |val| 
            @rev_priv_hierarchy[val] ||= []
            @rev_priv_hierarchy[val] << key
          end
        end
      end
      @rev_priv_hierarchy
    end
773050
def checkPieceHash(pieceIndex)
      id = returnAndIncrRequestId
      return id if @state == :after_stop
      @requests.push [id, :hash_piece, pieceIndex]
      @requestsSemaphore.signal
      id
    end
295053
def validate_status!
      raise SignalError.new(status) if status.signaled? # rubocop:disable Style/RaiseArgs
      raise CommandNotFoundError if status.exitstatus == COMMAND_NOT_FOUND
      raise Error, error_message unless status.success?
    end
15776
def hash(self):
        
        hash_request = etcdrpc.HashRequest()
        return self.maintenancestub.Hash(hash_request).hash
309308
def whitelist_redact_hash redact_hash
  	    digest_hash = {}
  	    
  	  	redact_hash.each do |key,how|
  	  	  if (how.to_sym == :digest)
  	  	    digest_hash[digest_key(key)] = :keep
  	  	  end
  	  	end
  	  	
  	  	digest_hash.merge redact_hash
	  end
1246725
def set_status(self, name, status):
        
        getattr(self.system, name).status = status
        return True
989411
def receive_status(proto, blockhash, chain_difficulty)
      logger.debug 'status received', proto: proto, chain_difficulty: chain_difficulty

      @protocols[proto] = chain_difficulty

      if @chainservice.knows_block(blockhash) || @synctask
        logger.debug 'existing task or known hash, discarding'
        return
      end

      if @force_sync
        blockhash, difficulty = force_sync
        logger.debug 'starting forced synctask', blockhash: Utils.encode_hex(blockhash)
        @synctask = SyncTask.new self, proto, blockhash, difficulty
      elsif chain_difficulty > @chain.head.chain_difficulty
        logger.debug 'sufficient difficulty'
        @synctask = SyncTask.new self, proto, blockhash, chain_difficulty
      end
    rescue
      logger.debug $!
      logger.debug $!.backtrace[0,10].join("\n")
    end
833277
def _handle_status(self, key, value):
        
        if key in (
                'NO_SECKEY',
                'BEGIN_DECRYPTION',
                'DECRYPTION_FAILED',
                'END_DECRYPTION',
                'GOOD_PASSPHRASE',
                'BAD_PASSPHRASE',
                'KEY_CONSIDERED'
            ):
            pass
        elif key == 'NODATA':
            self.status = nodata(value)
        elif key == 'ENC_TO':
            key, _, _ = value.split()
            if not self.key:
                self.key = key
            self.encrypted_to.append(key)
        elif key in ('NEED_PASSPHRASE', 'MISSING_PASSPHRASE'):
            self.need_passphrase = True
        elif key == 'NEED_PASSPHRASE_SYM':
            self.need_passphrase_sym = True
        elif key == 'USERID_HINT':
            self.userid_hint = value.strip().split()
        else:
            raise ValueError("Unknown status message: %r" % key)
175116
def update_status(status)
      if status.present?
        RRRSpec.redis.hset(key, 'status', status)
      else
        RRRSpec.redis.hdel(key, 'status')
      end
    end