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 452FE1972E for ; Fri, 4 Mar 2016 20:46:41 +0000 (UTC) Received: (qmail 61443 invoked by uid 500); 4 Mar 2016 20:46:41 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 61399 invoked by uid 500); 4 Mar 2016 20:46:41 -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 61219 invoked by uid 99); 4 Mar 2016 20:46:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 20:46:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B7BCE2C1F5A for ; Fri, 4 Mar 2016 20:46:40 +0000 (UTC) Date: Fri, 4 Mar 2016 20:46:40 +0000 (UTC) From: "Kevin Vasko (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-13271) Error: str() function only 1 takes parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-13271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kevin Vasko updated AMBARI-13271: --------------------------------- Flags: (was: Patch) > Error: str() function only 1 takes parameter > -------------------------------------------- > > Key: AMBARI-13271 > URL: https://issues.apache.org/jira/browse/AMBARI-13271 > Project: Ambari > Issue Type: Bug > Components: ambari-agent > Affects Versions: 2.1.1 > Environment: CentOS 7.0 > Reporter: Kevin Vasko > Priority: Minor > Attachments: AMBARI-13271.patch, patch.diff > > > In the file > /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py > and in the backup_file function I was getting an error staying Error: str() only takes 1 parameter but 2 were passed type error. > # Copy file and save with file.# (timestamp) > def backup_file(filePath): > if filePath is not None and os.path.exists(filePath): > timestamp = datetime.datetime.now() > format = '%Y%m%d%H%M%S' > try: > shutil.copyfile(filePath, filePath + "." + timestamp.strftime(format)) > except (Exception), e: > logger.warn('Could not backup file "%s": %s' % (str(filePath, e))) > return 0 > I do believe the exception handling line is incorrect and should be change from: > logger.warn('Could not backup file "%s": %s' % (str(filePath, e))) > to: > logger.warn('Could not backup file "%s": %s' % (str(filePath), e)) -- This message was sent by Atlassian JIRA (v6.3.4#6332)