AppController/djinn.rb
# An Array of DjinnJobData objects, each of which containing information about
# a node in the currently running AppScale deployment.
An Array of DjinnJobData objects, each of which containing information about
a node in the currently running AppScale deployment.
An Array of DjinnJobData objects each of which containing information about a node in the currently running AppScale deployment .
def add_role(new_role, secret)
    return BAD_SECRET_MSG unless valid_secret?(secret)
    Thread.new {
      start_roles = new_role.split(":")
      start_roles.each { |role|
        if my_node.jobs.include?(role)
          Djinn.log_info("Already running role #{role}, not invoking again")
        else
          Djinn.log_info("Adding and starting role #{role}")
          my_node.add_roles(role)
          send("start_#{role}".to_sym)
        end
      }
    }
    return "OK"
  end
def add_role ( new_role , secret ) return BAD_SECRET_MSG unless valid_secret? ( secret ) Thread . new { start_roles = new_role . split ( ":" ) start_roles . each { | role | if my_node . jobs . include? ( role ) Djinn . log_info ( "Already running role #{role}, not invoking again" ) else Djinn . log_info ( "Adding and starting role #{role}" ) my_node . add_roles ( role ) send ( "start_#{role}" . to_sym ) end } } return "OK" end
An Array of DjinnJobData objects, each of which containing information about
a node in the currently running AppScale deployment.
An Array of DjinnJobData objects each of which containing information about a node in the currently running AppScale deployment .
# new roles may run indefinitely in the background, so don't block # on them - just fire and forget # only start roles that we aren't already running # e.g., don't start_appengine if we already are, as this # will create two threads loading apps
new_role
<not_specific>
secret
<not_specific>