@@ -51,19 +51,23 @@ public VmWorkStart() {
5151 }
5252
5353 public DeploymentPlan getPlan () {
54- // this is ugly, to work with legacy code, we need to re-construct the DeploymentPlan hard-codely
55- // this has to be refactored together with migrating legacy code into the new way
5654
57- ReservationContext context = null ;
58- if (reservationId != null ) {
59- Journal journal = new Journal .LogJournal ("VmWorkStart" , s_logger );
60- context = new ReservationContextImpl (reservationId , journal , CallContext .current ().getCallingUser (), CallContext .current ().getCallingAccount ());
55+ if (podId != null || clusterId != null || hostId != null || poolId != null || physicalNetworkId != null ) {
56+ // this is ugly, to work with legacy code, we need to re-construct the DeploymentPlan hard-codely
57+ // this has to be refactored together with migrating legacy code into the new way
58+ ReservationContext context = null ;
59+ if (reservationId != null ) {
60+ Journal journal = new Journal .LogJournal ("VmWorkStart" , s_logger );
61+ context = new ReservationContextImpl (reservationId , journal , CallContext .current ().getCallingUser (), CallContext .current ().getCallingAccount ());
62+ }
63+
64+ DeploymentPlan plan = new DataCenterDeployment (
65+ dcId , podId , clusterId , hostId , poolId , physicalNetworkId ,
66+ context );
67+ return plan ;
6168 }
6269
63- DeploymentPlan plan = new DataCenterDeployment (
64- dcId , podId , clusterId , hostId , poolId , physicalNetworkId ,
65- context );
66- return plan ;
70+ return null ;
6771 }
6872
6973 public void setPlan (DeploymentPlan plan ) {
0 commit comments