Skip to content

Commit

Permalink
copying over JSON metadata file to head node so that it can use it to…
Browse files Browse the repository at this point in the history
… upload apps, fixing issue AppScale#20
  • Loading branch information
shatterednirvana committed Nov 12, 2012
1 parent defc80e commit d3d6d69
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/appscale_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ def self.run_instances(options)

userappserver_ip = acc.get_userappserver_ip(LOGS_VERBOSE)
CommonFunctions.update_locations_file(options['keyname'], [head_node_ip])
CommonFunctions.copy_nodes_json(options['keyname'], head_node_ip,
head_node_result[:true_key])
CommonFunctions.verbose("Run instances: UserAppServer is at #{userappserver_ip}", options['verbose'])
uac = UserAppClient.new(userappserver_ip, secret_key)
if options["admin_user"].nil? and options["admin_pass"].nil?
Expand Down
15 changes: 15 additions & 0 deletions lib/common_functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,21 @@ def self.write_nodes_json(new_role_info, keyname)
end


# Copies over the JSON metadata file that maps roles to who hosts them to the
# given IP address.
# Args:
# - keyname: The keyname of the AppScale deployment to copy over data for.
# - ip: The IP address that the JSON metadata file should be copied to.
# - ssh_key: The location on the local filesystem where an SSH key can be found
# that enables passwordless SSH access to the specified IP address.
def self.copy_nodes_json(keyname, ip, ssh_key)
locations_json = File.expand_path("~/.appscale/locations-#{keyname}.json")
remote_locations_json_file = "/root/.appscale/locations-#{keyname}.json"
CommonFunctions.scp_file(locations_json, remote_locations_json_file, ip,
ssh_key)
end


def self.write_and_copy_node_file(options, node_layout, head_node_result)
keyname = options['keyname']
head_node_ip = head_node_result[:head_node_ip]
Expand Down

0 comments on commit d3d6d69

Please sign in to comment.