def get_thread_name_from_context(context)
      thread_name = nil
      thread_name = context.thread_name if context.respond_to?(:thread_name)
      Log.warn("Encountered a nil thread name unexpectedly, defaulting to '#{RightScale::AgentConfig.default_thread_name}'") unless thread_name
      thread_name ||= RightScale::AgentConfig.default_thread_name
      unless thread_name =~ RightScale::AgentConfig.valid_thread_name
        raise ArgumentError, "Invalid thread name #{thread_name.inspect}"
      end
      thread_name
    end
def get_thread_name_from_context(context)
      thread_name = nil
      thread_name = context.thread_name if context.respond_to?(:thread_name)
      Log.warn("Encountered a nil thread name unexpectedly, defaulting to '#{RightScale::AgentConfig.default_thread_name}'") unless thread_name
      thread_name ||= RightScale::AgentConfig.default_thread_name
      unless thread_name =~ RightScale::AgentConfig.valid_thread_name
        raise ArgumentError, "Invalid thread name #{thread_name.inspect}"
      end
      thread_name
    end
Initialize sequence

 === Parameters
 context(RightScale::OperationContext):: Bundle to be run and associated audit

 === Options
 :pid_callback(Proc):: proc that will be called, passing self, when the PID of the child process becomes known
 :tag_query_timeout(Proc):: default 120 -- how many seconds to wait for the agent tag query to complete, before giving up and continuing
 FIX: thread_name should never be nil from the core in future, but
 temporarily we must supply the default thread_name before if nil. in
 future we should fail execution when thread_name is reliably present and
 for any reason does not match ::RightScale::AgentConfig.valid_thread_name
 see also ExecutableSequenceProxy#initialize

 === Parameters
 bundle(OperationalContext):: An operational context

 === Return
 result(String):: Thread name of this context