Skip to content

Commit

Permalink
VNF: fix NPE when list resourcedetails with resourcetype=VnfTemplate
Browse files Browse the repository at this point in the history
prior
```
(localcloud) 🐱 > list resourcedetails resourcetype=vnfTemplate resourceid=f2561ad3-21bc-4884-8263-eaf7e9b41e77
πŸ™ˆ Error: (HTTP 530, error code 9999) <nil>
```

now
```
(localcloud) 🐱 > list resourcedetails resourcetype=vnfTemplate resourceid=f2561ad3-21bc-4884-8263-eaf7e9b41e77
πŸ™ˆ Error: (HTTP 530, error code 9999) ResourceType VnfTemplate doesn't support metadata
```
  • Loading branch information
weizhouapache committed Nov 14, 2023
1 parent 4fdb6bd commit c305397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/server/ResourceTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
public enum ResourceObjectType {
UserVm(true, true, true),
Template(true, true, true),
VnfTemplate(true, true, true),
VnfTemplate(false, false, true),
ISO(true, false, true),
Volume(true, true),
Snapshot(true, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class ResourceManagerUtilImpl implements ResourceManagerUtil {
s_typeMap.put(ResourceTag.ResourceObjectType.UserVm, UserVmVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.Volume, VolumeVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.Template, VMTemplateVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.VnfTemplate, VMTemplateVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.ISO, VMTemplateVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.Snapshot, SnapshotVO.class);
s_typeMap.put(ResourceTag.ResourceObjectType.Network, NetworkVO.class);
Expand Down

0 comments on commit c305397

Please sign in to comment.