You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2013/12/04 16:59:14 UTC
git commit: AMBARI-3972. ambari-server update-metainfo: Should this
be supported? (Dmytro Shkvyra via dlysnichenko)
Updated Branches:
refs/heads/trunk e3d19b6ab -> 88d3a1a77
AMBARI-3972. ambari-server update-metainfo: Should this be supported? (Dmytro Shkvyra via dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/88d3a1a7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/88d3a1a7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/88d3a1a7
Branch: refs/heads/trunk
Commit: 88d3a1a777acad40c8eb38f68fb3414d66182ce2
Parents: e3d19b6
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Dec 4 17:57:35 2013 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Dec 4 17:58:39 2013 +0200
----------------------------------------------------------------------
ambari-server/sbin/ambari-server | 4 --
.../server/api/services/StacksService.java | 8 ---
ambari-server/src/main/python/ambari-server.py | 64 --------------------
3 files changed, 76 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/88d3a1a7/ambari-server/sbin/ambari-server
----------------------------------------------------------------------
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 41ca734..f540ae8 100644
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -100,10 +100,6 @@ case "$1" in
echo -e "Upgrading stack of ambari-server"
$PYTHON /usr/sbin/ambari-server.py $@
;;
- update-metainfo)
- echo -e "Updating ambari-server meta information"
- $PYTHON /usr/sbin/ambari-server.py $@
- ;;
setup)
echo -e "Setup ambari-server"
$PYTHON /usr/sbin/ambari-server.py $@
http://git-wip-us.apache.org/repos/asf/ambari/blob/88d3a1a7/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
index 3efcab7..31c4c31 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
@@ -49,14 +49,6 @@ public class StacksService extends BaseService {
createStackResource(null));
}
- @PUT
- @Produces("text/plain")
- public Response updateStacks(@Context HttpHeaders headers, @Context UriInfo ui) {
-
- return handleRequest(headers, null, ui, Request.Type.PUT,
- createStackResource(null));
- }
-
@GET
@Path("{stackName}")
@Produces("text/plain")
http://git-wip-us.apache.org/repos/asf/ambari/blob/88d3a1a7/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py
index 99cc07c..35019d6 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -56,7 +56,6 @@ STOP_ACTION = "stop"
RESET_ACTION = "reset"
UPGRADE_ACTION = "upgrade"
UPGRADE_STACK_ACTION = "upgradestack"
-UPDATE_METAINFO_ACTION = "update-metainfo"
STATUS_ACTION = "status"
SETUP_HTTPS_ACTION = "setup-https"
LDAP_SETUP_ACTION = "setup-ldap"
@@ -224,7 +223,6 @@ SETUP_DB_CMD = ['su', '-', 'postgres',
'--command=psql -f {0} -v username=\'"{1}"\' -v password="\'{2}\'" -v dbname="{3}"']
UPGRADE_STACK_CMD = ['su', 'postgres',
'--command=psql -f {0} -v stack_name="\'{1}\'" -v stack_version="\'{2}\'" -v dbname="{3}"']
-UPDATE_METAINFO_CMD = 'curl -X PUT "http://{0}:{1}/api/v1/stacks2" -u "{2}":"{3}"'
PG_ERROR_BLOCKED = "is being accessed by other users"
@@ -570,66 +568,6 @@ def run_os_command(cmd):
return process.returncode, stdoutdata, stderrdata
#
-# Updates metainfo information from stack root. Re-cache information from
-# repoinfo.xml , metainfo.xml files , etc.
-#
-def update_metainfo(args):
- configure_update_metainfo_args(args)
-
- hostname = args.hostname
- port = args.port
- username = args.username
- password = args.password
-
- command = UPDATE_METAINFO_CMD
- command = command.format(hostname, port, username, password)
- retcode, outdata, errdata = run_os_command(command)
-
- if outdata.find("Bad credentials") > 0:
- print 'Incorrect credential provided. Please try again.'
-
- if not retcode == 0:
- print errdata
- return retcode
-
-def configure_update_metainfo_args(args):
- conf_file = search_file(AMBARI_PROPERTIES_FILE, get_conf_dir())
- properties = Properties()
-
- try:
- properties.load(open(conf_file))
- except Exception, e:
- print 'Could not read ambari config file "%s": %s' % (conf_file, e)
- return -1
-
-
- default_username = "admin"
-
- username_prompt = 'Username [' + default_username + ']: '
- password_prompt = 'Password: '
- input_pattern = "^[a-zA-Z_][a-zA-Z0-9_\-]*$"
-
- hostname = socket.gethostname()
- port = properties[CLIENT_API_PORT_PROPERTY]
-
- if not port:
- port = CLIENT_API_PORT
-
- input_descr = "Invalid characters in received. Start with _ or alpha "\
- "followed by alphanumeric or _ or - characters"
-
- print 'Full authentication is required to access the Ambari API'
- username = get_validated_string_input(username_prompt, default_username,
- input_pattern, input_descr, False)
- password = get_validated_string_input(password_prompt, "", input_pattern,
- input_descr, True)
-
- args.hostname = hostname
- args.port = port
- args.username = username
- args.password = password
-
-#
# Checks SELinux
#
def check_selinux():
@@ -4028,8 +3966,6 @@ def main():
upgrade_stack(options, stack_id)
elif action == LDAP_SETUP_ACTION:
setup_ldap()
- elif action == UPDATE_METAINFO_ACTION:
- update_metainfo(options)
elif action == SETUP_SECURITY_ACTION:
need_restart = setup_security(options)
else: