You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by nir-sopher <gi...@git.apache.org> on 2017/07/27 12:25:27 UTC

[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

GitHub user nir-sopher opened a pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/758

    [TC-478] Parameter value can be changed to 0

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nir-sopher/incubator-trafficcontrol parameter-value-can-change-to-0

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafficcontrol/pull/758.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #758
    
----
commit 5381c7b944be55a062aeecf7fe0aee298ed5f598
Author: nir-sopher <ni...@qwilt.com>
Date:   2017-07-23T07:47:54Z

    Parameter value can be changed to 0

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/758#discussion_r131001497
  
    --- Diff: traffic_ops/app/lib/API/Parameter.pm ---
    @@ -317,7 +317,7 @@ sub update {
     
         my $name = $params->{name} || $find->name;
         my $configFile = $params->{configFile} || $find->config_file;
    -    my $value = $params->{value} || $find->value;
    +    my $value = exists($params->{value}) ?  $params->{value} : $find->value;
    --- End diff --
    
    what does this allow you to do? to set the parameter value to null? is that what you want to do?
    
    it sounds like by the name of the PR you want to set a parameter value to 0...but parameter values are strings so can you set the value to "0" without this change? and is that sufficient?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafficcontrol/pull/758


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

Posted by nir-sopher <gi...@git.apache.org>.
Github user nir-sopher commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/758#discussion_r131065694
  
    --- Diff: traffic_ops/app/lib/API/Parameter.pm ---
    @@ -317,7 +317,7 @@ sub update {
     
         my $name = $params->{name} || $find->name;
         my $configFile = $params->{configFile} || $find->config_file;
    -    my $value = $params->{value} || $find->value;
    +    my $value = exists($params->{value}) ?  $params->{value} : $find->value;
    --- End diff --
    
    I would like to allow to set the value to 0.
    
    **Apparently in Perl the string "0" is equivalent to False....**
    See http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F
    
    I can replace the "exists" with "defined" if you prefer. I believe that logically "exists"is better, but it really does not matter for this case


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/758#discussion_r131186253
  
    --- Diff: traffic_ops/app/lib/API/Parameter.pm ---
    @@ -317,7 +317,7 @@ sub update {
     
         my $name = $params->{name} || $find->name;
         my $configFile = $params->{configFile} || $find->config_file;
    -    my $value = $params->{value} || $find->value;
    +    my $value = exists($params->{value}) ?  $params->{value} : $find->value;
    --- End diff --
    
    ok, makes sense. i forgot how perl treats 0 or "0"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---