ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Onischuk (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMBARI-3652) Resource Management. Allow to use params substitution in strings, to reduce boilerplate and error-prone code.
Date Fri, 01 Nov 2013 13:55:17 GMT
Andrew Onischuk created AMBARI-3652:
---------------------------------------

             Summary: Resource Management. Allow to use params substitution in strings, to
reduce boilerplate and error-prone code.
                 Key: AMBARI-3652
                 URL: https://issues.apache.org/jira/browse/AMBARI-3652
             Project: Ambari
          Issue Type: Bug
            Reporter: Andrew Onischuk
            Assignee: Andrew Onischuk
             Fix For: 1.5.0


As it is now:
{code}
   Execute ( "hive mkdir -p %s ; curl -kf --retry 10 %s -o %s &&  cp %s %s" % (conf.artifact_dir,
conf.driver_curl_source, conf.driver_curl_target, conf.driver_curl_target, conf.target),
       command = "mkdir -p %s ; curl -kf --retry 10 %s -o %s &&  cp %s %s" % ( conf.artifact_dir
,conf.driver_curl_source ,conf.driver_curl_target ,conf.driver_curl_target ,conf.target) ,
       unless  = "test -f %s" % (conf.target),
       path    = ["/bin","/usr/bin/"]
     )
{code}
As it should be:
{code}
   Execute ( 'hive mkdir -p ${artifact_dir} ; curl -kf --retry 10 ${driver_curl_source} -o
${driver_curl_target} &&  cp ${driver_curl_target} ${target}',
       command = "mkdir -p ${artifact_dir} ; curl -kf --retry 10 ${driver_curl_source} -o
${driver_curl_target} &&  cp ${driver_curl_target} ${target}",
       unless  = "test -f ${target}",
       path    = ["/bin","/usr/bin/"]
     )
{code}

This should be done because:
- First one is more error-prone, since orders can be messed up.
- First one makes code less readable




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message