Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20C0017FA2 for ; Fri, 6 Feb 2015 23:43:50 +0000 (UTC) Received: (qmail 54265 invoked by uid 500); 6 Feb 2015 23:43:50 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 54236 invoked by uid 500); 6 Feb 2015 23:43:50 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 54227 invoked by uid 99); 6 Feb 2015 23:43:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2015 23:43:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DA427E01C2; Fri, 6 Feb 2015 23:43:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: commits@ambari.apache.org Message-Id: <4ec3ecd2a29d4e97a2ed4ca976070611@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-9475. Upgrade pack definition for Ranger. (Velmurugan Periasamy via yusaku) Date: Fri, 6 Feb 2015 23:43:49 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 405b3762c -> 56e90a3a4 AMBARI-9475. Upgrade pack definition for Ranger. (Velmurugan Periasamy via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/56e90a3a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/56e90a3a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/56e90a3a Branch: refs/heads/trunk Commit: 56e90a3a49e77776b32f45503a032bbf4a14de63 Parents: 405b376 Author: Yusaku Sako Authored: Fri Feb 6 15:43:39 2015 -0800 Committer: Yusaku Sako Committed: Fri Feb 6 15:43:46 2015 -0800 ---------------------------------------------------------------------- .../RANGER/0.4.0/package/scripts/upgrade.py | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/56e90a3a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/upgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/upgrade.py new file mode 100644 index 0000000..62abe8c --- /dev/null +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/upgrade.py @@ -0,0 +1,29 @@ + +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" +from resource_management import * +from resource_management.core.resources.system import Execute +from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version + +def prestart(env, hdp_component): + import params + + if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + Execute("hdp-select set {0} {1}".format(hdp_component, version)) \ No newline at end of file