CA Client Automation

  • 1.  Using quotes to pass item_name during swpolicy addItem results in random packages being added

    Posted Jul 21, 2017 02:22 PM

    I've struggled with trying to pass the name of an item like a package, dynamic group, etc when using the cadsmcmd commands so I tried something new.  Using the string (partial string here) cadsmcmd....swPolicy action=addItem name=GG752189 item="New Patch"...etc etc.  This is part of a larger routine that builds a policy, links a group, then adds a package to the jobs before sealing.  This routine works fine when there are no spaces in the package name, but I tried something new just now by encapsulating the package name in quotes.  When I do this, the automation succeeds however I get more than just the one package I'm asking for added.  I deleted the policy, built a new one and tried again...this time I got the package I wanted plus two others.  Tried again...this time I get other packages I didn't ask for added.

     

    Very strange indeed.  We're running 14 SP1.  Bottom line is I'd like to be able NOT have a restriction package names I use with automation, since I don't control what others build.  So if there's a good way to pass a pkg name with spaces (or anything else) using the automation, I'd appreciate someone letting me know.



  • 2.  Re: Using quotes to pass item_name during swpolicy addItem results in random packages being added

    Posted Jul 21, 2017 02:26 PM

    Oh and one more thing...sometimes when I run the same command, it adds packages but not the one I'm asking for in the command line.  HA



  • 3.  Re: Using quotes to pass item_name during swpolicy addItem results in random packages being added

    Posted Jul 21, 2017 02:44 PM

    Hi George,

     

    I just tested this on 14 SP1 and had no problem creating a swpolicy from command line with a package name containing spaces and of course enclosed in quotes. In fact my procedure name, policy name and target group name also contained spaces and were enclosed in quotes. I’ve been doing this kind of thing for years with scripts and never encountered such a problem, except of course in DM scripts enclosing quotes inside already quoted strings (since the quote is also an escape character and single quotes are comments) is a minor challenge, easy to do when you know how but looks very confusing in the script.

     

    Please provide actual samples of the commands you are running (change names as needed for privacy concerns) so we can hopefully identify where the problem lies.

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Stephen.McCormick@ca.com

    <mailto:Stephen.McCormick@ca.com>



  • 4.  Re: Using quotes to pass item_name during swpolicy addItem results in random packages being added

    Posted Jul 21, 2017 03:05 PM

    Easily repeatable in my environment.  Here's the full line minus my login string...

     

    cadsmcmd local edsm-fxo-dom02.corp.ds.fedex.com swPolicy action=addItem name=GG752189 item="MS1707 - KB4025339 July Security Update Rollup - Win10x64 1607" version=v1 procedure=ApplyUpdates offline=y stagingServer=y jobtimeout=0.8 login=

     

    Last time I ran it, it added two packages to the policy and didn't even include the one above in the line.



  • 5.  Re: Using quotes to pass item_name during swpolicy addItem results in random packages being added

    Posted Jul 21, 2017 03:22 PM

    Hi George,

     

    I created a package with that same name, version and procedure name and ran the command exactly as you had it, except I was on the Domain so I removed the ‘local



  • 6.  Re: Using quotes to pass item_name during swpolicy addItem results in random packages being added
    Best Answer

    Broadcom Employee
    Posted Jul 23, 2017 09:35 PM

    Hi George,

     

    I recommend you to open a support case to investigate this further as the command seems correct but the expected behaviour is not normal.

     

    Regards,

    Lenny