@Inject
OpenstackCloudHelpers openstackHelpers;
@Handler
public void handler(OpenstackCloud cloud, OpenstackComputeMachine machine) throws OpsException, OpenstackException {
CloudBehaviours cloudBehaviours = new CloudBehaviours(cloud);
OpenstackComputeClient openstackComputeClient = cloudContext.getComputeClient(cloud);
// Find the public address, although the OpenStack firewall may be blocking it
publicAddress = machine.getNetworkPoint().getBestAddress(NetworkPoint.forPublicInternet());
if (cloudBehaviours.supportsSecurityGroups()) {
Server server = machine.getServer();
SecurityGroup securityGroup = openstackHelpers.getMachineSecurityGroup(openstackComputeClient, server);
securityGroup = openstackComputeClient.root().securityGroups().securityGroup(securityGroup.getId()).show();