Release Automation

Expand all | Collapse all

Do we have any restrictions on the Replace Text in a File action??

  • 1.  Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 09:03 AM

    I am trying to replace some parameter in (.cfg) file and it is in XML format but the action says that it cannot fine that parameter.

    I am also giving the parameter and value in the same manner as its specified in the file.



  • 2.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 09:30 AM

    Can you share more information on the action settings, the error you got and the relevant file content?



  • 3.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 09:42 AM

    I am getting below Error.

    What I am doing here is just getting the hostname from the command line and passing to Replace action for replacing that hostname in parameter.

     

     

                               

              Finished unsuccessfully. Text hubname = manab01-U168807 was not found in file [E:\CA\UIM\test\test.cfg]
                     


  • 4.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 09:56 AM

    You didn't provide the action settings so its hard to see what is wrong.

    If you running command line to get the hostname - are you also trimming the output? could be your parameter including the hostname also include new line which cause the find action to failed.

    You can also see the extra space in the nolio_all.log



  • 5.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 09:59 AM

    Yes I am trimming it as well but it still gives the same error.

     



  • 6.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:02 AM

    I would watch for spaces.....you have a space around the "=" in your search text.......are there EXACTLY one space in the .cfg file? 



  • 7.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:09 AM

    Yes its the same way defined in that file with one space before and after the (=) symbol.

    Its kind of strange why its doesn't work.



  • 8.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:08 AM

    Did you check nolio_all.log what are the values its comparing?



  • 9.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:17 AM

    Log doesn't say much about the values.

    Its just showing the signal acknowledgement between tow systems.



  • 10.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:25 AM

    In the agent nolio_all.log you will see the exact values.

    Another rare problem might be that file encoding, can you verify if its utf-8 or other common type?



  • 11.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 10:38 AM

    Hi Jacky,

     

    Is anyone can do a quick call to help me out.

    I cannot proceed without this.



  • 12.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 11:01 AM

    I think you will need contact support for this.



  • 13.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 12:12 PM

    Does this action is case sensitive??

    I guess we don't have any setting in this action which can deactivate this option for case sensitive or Can we use some other actions which is not case sensitive??



  • 14.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 01:00 PM

    The action search for the text as is in case you don't set the search option as regex

    If you don't care what is the hubname you can try to search using regex hubname = (.*)



  • 15.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 15, 2016 05:17 PM

    I tried using that regex instead of passing some value to that parameter but it doesn't work, Do we need to provide something else with that regex?



  • 16.  Re: Do we have any restrictions on the Replace Text in a File action??
    Best Answer

    Broadcom Employee
    Posted Apr 16, 2016 01:23 PM

    the replace text should work.  I tried you example and had no problem.   As you mentioned above, case does make a difference.  I never trust the format(case) of the host name in windows.  I use the javascript action to make it lower case.  Pretty straight forward,

    regards



  • 17.  Re: Do we have any restrictions on the Replace Text in a File action??

    Posted Apr 17, 2016 04:21 AM

    Best way to assist you will be if you could send us the relevant part of the file that you would like to replace , the failed action input information (Once the action in failed_pause look at the additional information) and the nolio_all.llog of the agent that run the action.