Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F57D102BE for ; Mon, 24 Nov 2014 17:39:13 +0000 (UTC) Received: (qmail 37273 invoked by uid 500); 24 Nov 2014 17:39:12 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 37239 invoked by uid 500); 24 Nov 2014 17:39:12 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 37027 invoked by uid 99); 24 Nov 2014 17:39:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Nov 2014 17:39:12 +0000 Date: Mon, 24 Nov 2014 17:39:12 +0000 (UTC) From: "Dmytro Sen (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMBARI-8429) Refactor version comparisons to use function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Dmytro Sen created AMBARI-8429: ---------------------------------- Summary: Refactor version comparisons to use function Key: AMBARI-8429 URL: https://issues.apache.org/jira/browse/AMBARI-8429 Project: Ambari Issue Type: Bug Components: stacks Affects Versions: 1.7.0 Reporter: Dmytro Sen Assignee: Dmytro Sen Fix For: 2.0.0 In Ambari 1.7.0, we started introducing checks for the HDP version like stack_is_hdp22_or_further = not (stack_version.startswith('2.0') or stack_version.startswith('2.1')) This may lead to problems in future HDP versions. Instead, we should create a function/class for doing version comparisons. ambari-server.py already has a method called compare_versions() that compares the each segment of a version (separated by dots). -- This message was sent by Atlassian JIRA (v6.3.4#6332)