ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-13271) Error: str() function only 1 takes parameter
Date Sat, 05 Mar 2016 02:36:40 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-13271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15181461#comment-15181461
] 

Hadoop QA commented on AMBARI-13271:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12791511/AMBARI-13271.patch
  against trunk revision .

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include any new or modified
tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of
javac compiler warnings.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number
of release audit warnings.

    {color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/Ambari-trunk-test-patch/5738//testReport/
Console output: https://builds.apache.org/job/Ambari-trunk-test-patch/5738//console

This message is automatically generated.

> 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)

Mime
View raw message