Skip to content

Commit 659ce52

Browse files
vladimirpetrovsudo87harikrishna-patnala
authored andcommitted
Fix terms, typos and grammar mistakes in the API, error messages, events, etc. (apache#7857)
This PR aligns the use of terminology, renaming VM / virtual machine references to 'Instance' and also capitalising the terms Templates, Network, Snapshot, User, Account in CloudStack APIs, error and log messages, events, tooltips, etc. Many typos, grammar and spelling mistakes were fixed, also terms like IPv4, VPN, VPC, etc. were properly capitalised. Some error messages were cleaned for better readability. The test cases, expecting some exception strings were adjusted accordingly. Here is the wiki page, describing the changes in details: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Object+Naming+and+Title+Case+Convention --------- Co-authored-by: Manoj Kumar <manojkr.itbhu@gmail.com> Co-authored-by: Harikrishna <harikrishna.patnala@gmail.com>
1 parent 43ac44f commit 659ce52

1,118 files changed

Lines changed: 7759 additions & 6820 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ private Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, fin
175175
try {
176176
is.close();
177177
} catch (final IOException e) {
178-
logger.warn("Exception when closing , console proxy address : {}", proxyManagementIp);
178+
logger.warn("Exception when closing , console proxy address: {}", proxyManagementIp);
179179
success = false;
180180
}
181181
}
182182
} catch (final IOException e) {
183-
logger.warn("Unable to open console proxy command port url, console proxy address : {}", proxyManagementIp);
183+
logger.warn("Unable to open console proxy command port url, console proxy address: {}", proxyManagementIp);
184184
success = false;
185185
}
186186

api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ private DatadiskTO generateDiskTO(OVFFile file, OVFDisk disk, String ovfParentPa
277277
if (StringUtils.isNotBlank(path)) {
278278
File f = new File(path);
279279
if (!f.exists() || f.isDirectory()) {
280-
logger.error("One of the attached disk or iso does not exists {}", path);
281-
throw new InternalErrorException("One of the attached disk or iso as stated on OVF does not exists " + path);
280+
logger.error("One of the attached disk or ISO does not exists " + path);
281+
throw new InternalErrorException("One of the attached disk or ISO as stated on OVF does not exists " + path);
282282
}
283283
}
284284
Long capacity = disk != null ? disk._capacity : file._size;
@@ -333,7 +333,9 @@ protected List<OVFDisk> extractDisksFromOvfDocumentTree(Document doc) {
333333
od._controller = getControllerType(items, od._diskId);
334334
vd.add(od);
335335
}
336-
logger.trace("Found {} disk definitions", vd.size());
336+
if (logger.isTraceEnabled()) {
337+
logger.trace(String.format("Found %d disk definitions", vd.size()));
338+
}
337339
return vd;
338340
}
339341

@@ -363,7 +365,9 @@ protected List<OVFFile> extractFilesFromOvfDocumentTree(File ovfFile, Document d
363365
vf.add(of);
364366
}
365367
}
366-
logger.trace("Found {} file definitions in {}", vf.size(), ovfFile.getPath());
368+
if (logger.isTraceEnabled()) {
369+
logger.trace(String.format("Found %d file definitions in %s", vf.size(), ovfFile.getPath()));
370+
}
367371
return vf;
368372
}
369373

@@ -517,7 +521,9 @@ OVFFile getFileDefinitionFromDiskDefinition(String fileRef, List<OVFFile> files)
517521

518522
public List<OVFNetworkTO> getNetPrerequisitesFromDocument(Document doc) throws InternalErrorException {
519523
if (doc == null) {
520-
logger.trace("No document to parse; returning no prerequisite networks");
524+
if (logger.isTraceEnabled()) {
525+
logger.trace("No document to parse; returning no prerequisite Networks");
526+
}
521527
return Collections.emptyList();
522528
}
523529

@@ -533,15 +539,19 @@ public List<OVFNetworkTO> getNetPrerequisitesFromDocument(Document doc) throws I
533539
private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement) {
534540
final DocumentTraversal traversal = (DocumentTraversal) systemElement;
535541
final NodeIterator iterator = traversal.createNodeIterator(systemElement, NodeFilter.SHOW_ELEMENT, null, true);
536-
logger.trace("Starting out with {} network-prerequisites, parsing hardware", nets.size());
542+
if (logger.isTraceEnabled()) {
543+
logger.trace(String.format("Starting out with %d network-prerequisites, parsing hardware",nets.size()));
544+
}
537545
int nicCount = 0;
538546
for (Node n = iterator.nextNode(); n != null; n = iterator.nextNode()) {
539547
final Element e = (Element) n;
540548
if ("rasd:Connection".equals(e.getTagName())) {
541549
nicCount++;
542550
String name = e.getTextContent(); // should be in our nets
543551
if(nets.get(name) == null) {
544-
logger.info("Found a nic definition without a network definition by name {}, adding it to the list.", name);
552+
if(logger.isInfoEnabled()) {
553+
logger.info(String.format("Found a NIC definition without a Network definition by name %s, adding it to the list.", name));
554+
}
545555
nets.put(name, new OVFNetworkTO());
546556
}
547557
OVFNetworkTO thisNet = nets.get(name);
@@ -550,7 +560,9 @@ private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement)
550560
}
551561
}
552562
}
553-
logger.trace("Ending up with {} network-prerequisites, parsed {} nics", nets.size(), nicCount);
563+
if (logger.isTraceEnabled()) {
564+
logger.trace(String.format("Ending up with %d network-prerequisites, parsed %d NICs", nets.size(), nicCount));
565+
}
554566
}
555567

556568
/**
@@ -617,7 +629,9 @@ private Map<String, OVFNetworkTO> getNetworksFromDocumentTree(Document doc) {
617629

618630
nets.put(networkName,network);
619631
}
620-
logger.trace("Found {} networks in template", nets.size());
632+
if (logger.isTraceEnabled()) {
633+
logger.trace(String.format("Found %d Networks in Template", nets.size()));
634+
}
621635
return nets;
622636
}
623637

api/src/main/java/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
3535
//////////////// API parameters /////////////////////
3636
/////////////////////////////////////////////////////
3737

38-
@Parameter(name = ApiConstants.SNAPSHOT_POLICY_ID, type = CommandType.LONG, description = "lists recurring snapshots by snapshot policy ID")
38+
@Parameter(name = ApiConstants.SNAPSHOT_POLICY_ID, type = CommandType.LONG, description = "Lists recurring Snapshots by Snapshot policy ID")
3939
private Long snapshotPolicyId;
4040

41-
@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, required = true, description = "list recurring snapshots by volume ID")
41+
@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, required = true, description = "List recurring Snapshots by volume ID")
4242
private Long volumeId;
4343

4444
/////////////////////////////////////////////////////

api/src/main/java/com/cloud/network/Ipv6Service.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface Ipv6Service extends PluggableService, Configurable {
4545
static final ConfigKey<Boolean> Ipv6OfferingCreationEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class,
4646
"ipv6.offering.enabled",
4747
"false",
48-
"Indicates whether creation of IPv6 network/VPC offering is enabled or not.",
48+
"Indicates whether creation of IPv6 Network/VPC offering is enabled or not.",
4949
true);
5050

5151
static final ConfigKey<Integer> Ipv6PrefixSubnetCleanupInterval = new ConfigKey<Integer>("Advanced", Integer.class,

api/src/main/java/com/cloud/network/Network.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ enum Event {
325325

326326
public enum State {
327327

328-
Allocated("Indicates the network configuration is in allocated but not setup"), Setup("Indicates the network configuration is setup"), Implementing(
329-
"Indicates the network configuration is being implemented"), Implemented("Indicates the network configuration is in use"), Shutdown(
330-
"Indicates the network configuration is being destroyed"), Destroy("Indicates that the network is destroyed");
328+
Allocated("Indicates the Network configuration is in allocated but not setup"), Setup("Indicates the Network configuration is setup"), Implementing(
329+
"Indicates the Network configuration is being implemented"), Implemented("Indicates the Network configuration is in use"), Shutdown(
330+
"Indicates the Network configuration is being destroyed"), Destroy("Indicates that the Network is destroyed");
331331

332332
protected static final StateMachine2<State, Network.Event, Network> s_fsm = new StateMachine2<State, Network.Event, Network>();
333333

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public interface NetworkService {
8181
true, ConfigKey.Scope.Zone);
8282

8383
public static final ConfigKey<Boolean> AllowUsersToSpecifyVRMtu = new ConfigKey<>("Advanced", Boolean.class,
84-
"allow.end.users.to.specify.vr.mtu", "false", "Allow end users to specify VR MTU",
84+
"allow.end.users.to.specify.vr.mtu", "false", "Allow end Users to specify VR MTU",
8585
true, ConfigKey.Scope.Zone);
8686

8787
List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);

api/src/main/java/com/cloud/network/as/AutoScaleVmGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static State fromValue(String state) {
4343
} else if (state.equalsIgnoreCase("scaling")) {
4444
return SCALING;
4545
} else {
46-
throw new IllegalArgumentException("Unexpected AutoScale VM group state : " + state);
46+
throw new IllegalArgumentException("Unexpected AutoScale Instance group state : " + state);
4747
}
4848
}
4949
}

api/src/main/java/com/cloud/user/ResourceLimitService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
public interface ResourceLimitService {
3535

3636
static final ConfigKey<Long> MaxAccountSecondaryStorage = new ConfigKey<>("Account Defaults", Long.class, "max.account.secondary.storage", "400",
37-
"The default maximum secondary storage space (in GiB) that can be used for an account", false);
37+
"The default maximum secondary storage space (in GiB) that can be used for an Account", false);
3838
static final ConfigKey<Long> MaxProjectSecondaryStorage = new ConfigKey<>("Project Defaults", Long.class, "max.project.secondary.storage", "400",
3939
"The default maximum secondary storage space (in GiB) that can be used for a project", false);
4040
static final ConfigKey<Long> ResourceCountCheckInterval = new ConfigKey<>("Advanced", Long.class, "resourcecount.check.interval", "300",

api/src/main/java/com/cloud/vm/snapshot/VMSnapshot.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<VMSnapshot.State> {
3030

3131
enum State {
32-
Allocated("The VM snapshot is allocated but has not been created yet."), Creating("The VM snapshot is being created."), Ready(
33-
"The VM snapshot is ready to be used."), Reverting("The VM snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
34-
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered"),
35-
Hidden("The VM snapshot is hidden from the user and cannot be recovered.");
32+
Allocated("The Instance Snapshot is allocated but has not been created yet."), Creating("The Instance Snapshot is being created."), Ready(
33+
"The Instance Snapshot is ready to be used."), Reverting("The Instance Snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
34+
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered");
3635

3736
String _description;
3837

api/src/main/java/org/apache/cloudstack/acl/RoleType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ public static Set<RoleType> fromCombinedMask(int combinedMask) {
132132
* */
133133
public static Account.Type getAccountTypeByRole(final Role role, final Account.Type defautAccountType) {
134134
if (role != null) {
135-
LOGGER.debug("Role [{}] is not null; therefore, we use its account type [{}].", role, defautAccountType);
135+
LOGGER.debug(String.format("Role [%s] is not null; therefore, we use its Account type [%s].", role, defautAccountType));
136136
return role.getRoleType().getAccountType();
137137
}
138-
LOGGER.debug("Role is null; therefore, we use the default account type [{}] value.", defautAccountType);
138+
LOGGER.debug(String.format("Role is null; therefore, we use the default Account type [%s] value.", defautAccountType));
139139
return defautAccountType;
140140
}
141141
}

0 commit comments

Comments
 (0)