diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaParserModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaParserModule.java index aff38f8851..9528d158d6 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaParserModule.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaParserModule.java @@ -58,8 +58,7 @@ public class NovaParserModule extends AbstractModule { return ImmutableMap.of( HostResourceUsage.class, new HostResourceUsageAdapter(), ServerWithSecurityGroups.class, new ServerWithSecurityGroupsAdapter(), - Server.class, new ServerAdapter(), - SecurityGroupRule.class, new SecurityGroupRuleAdapter() + Server.class, new ServerAdapter() ); } @@ -153,35 +152,4 @@ public class NovaParserModule extends AbstractModule { } } } - - /* trying to cope with group { } to signify no group! */ - @Singleton - public static class SecurityGroupRuleAdapter implements JsonDeserializer { - @Override - public SecurityGroupRule deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) - throws JsonParseException { - SecurityGroupRule ruleBase = apply((SecurityGroupRuleInternal) context.deserialize(jsonElement, SecurityGroupRuleInternal.class)); - if (jsonElement.getAsJsonObject().has("group")) { - try { - TenantIdAndName group = context.deserialize(jsonElement.getAsJsonObject().getAsJsonObject("group"), TenantIdAndName.class); - ruleBase = ruleBase.toBuilder().group(group).build(); - } catch (NullPointerException ex) { - } - } - return ruleBase; - } - - public SecurityGroupRule apply(SecurityGroupRuleInternal in) { - return in.toBuilder().build(); - } - - private static class SecurityGroupRuleInternal extends SecurityGroupRule { - @ConstructorProperties({ - "ip_protocol", "from_port", "to_port", "id", "parent_group_id", "ip_range" - }) - protected SecurityGroupRuleInternal(IpProtocol ipProtocol, int fromPort, int toPort, String id, String parentGroupId, @Nullable Cidr ipRange) { - super(ipProtocol, fromPort, toPort, id, null, parentGroupId, ipRange); - } - } - } }