N1 Service Provisioning System - Installing components using auto-generated plans from Jython CL

Hi All,

for specific reasons, we want to install a set of components with fixed signatures from Jython CLI, butwithout appropriate plans. In fact, we want to simulate the behavior that we know from Plugin UI, i.e. linking directly to an installer of a component.

We figured the following steps are necessary within CLI code:

1) For the targeted component generate an appropriate install plan using 'pdb.p.genplan' command. This unfortunately does not create the plan within the system, but rather has to be redirected to a file.

2) Import the previously generated plan using 'pdb.p.ci' command from this file.

3) run the plan using fixed signature to install component

4) eventually remove the plan.

Now, the problem is, that step 1) generates a plan targeted for the folder '/system/autogen', but step 2) fails on importing the plan there, because the folder is owned by the system plugin. So we would end up parsing the XML file, replacing path and so on .... We definately don't want to reinvent the wheel, here.

Any help appreciated!!!

Regards,

Frank

[1148 byte] By [maverick_1601a] at [2008-2-14]
# 1

Hey Frank

The sad news is that you have to parse and replace path:s.... I would probably use a pre-gen XML code in the JYthon script and just figure out which component to install and write that to a new file and check it in, capture the PlanID and then execute it. Run the wait for plan, cli-command and then delete it.

HTH,

Peter

chappea at 2007-7-10 > top of java,Administration Tools,N1 Service Provisioning System...
# 2

First of all, thanks for the super-fast reply.

We got around with parsing using the xml.dom.minidom package in Python. Three more lines and poorer performance, but nothing you can measure against the CLI performance itself ;-)

I like the idea of using a template plan, as you suggested, because the generated ones bear another problem: We have to pipe in the plan parameters, which we don't know for sure, except for one, that is the 'markOnly' flag. So this might get us around piping in stupid dummy params.

How exactly do you wait for the plan completion? We use 'pe.p.lo', but don't know how to figure out, if it was successful or not, at all. No return code this time, and stdout isn't filled in markOnly=true mode.

Regards,

Frank

maverick_1601a at 2007-7-10 > top of java,Administration Tools,N1 Service Provisioning System...
# 3

Well, using a template plan doesn't work out, because we have arguments on our default methods, that do not have any default values. Although, they are not used in markOnly mode, we don't want to change this. The plan generation command investigates those, however, so I think we are stuck with this method.

Regards,

Frank

maverick_1601a at 2007-7-10 > top of java,Administration Tools,N1 Service Provisioning System...