Skip to content

Commit f2ee0b7

Browse files
jbamptonDaanHooglanddaviftorresandrijapanicsbJoaoJandre
authored
Fix grammar, spelling, word casing, whitespace (#9132)
* Fix grammar, spelling, word casing, whitespace * Update api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update server/src/main/java/com/cloud/network/NetworkServiceImpl.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update server/src/test/java/com/cloud/vm/UserVmManagerTest.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update server/src/test/java/com/cloud/vm/UserVmManagerTest.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Update tools/git/git-pr * Fix up test failure * Fix up test * Update api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java Co-authored-by: dahn <daan.hoogland@gmail.com> * Apply suggestions from code review Co-authored-by: Davi Torres <90287660+daviftorres@users.noreply.github.com> * Apply batched suggestions from code review Stop talking, do some work... Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com> * Fix formatting of exception message in UserVmManagerImpl Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: dahn <daan.hoogland@gmail.com> Co-authored-by: dahn <daan@onecht.net> Co-authored-by: Davi Torres <90287660+daviftorres@users.noreply.github.com> Co-authored-by: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com> Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com> Co-authored-by: Andrija Panic <andrija.panic@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c5bd11a commit f2ee0b7

11 files changed

Lines changed: 307 additions & 308 deletions

File tree

‎framework/db/src/main/java/com/cloud/utils/db/EcInfo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public EcInfo(Attribute attr, Attribute idAttr) {
6868
}
6969

7070
CollectionTable ct = attr.field.getAnnotation(CollectionTable.class);
71-
assert (ct.name().length() > 0) : "Please sepcify the table for " + attr.field.getName();
71+
assert (ct.name().length() > 0) : "Please specify the table for " + attr.field.getName();
7272
StringBuilder selectBuf = new StringBuilder("SELECT ");
7373
StringBuilder insertBuf = new StringBuilder("INSERT INTO ");
7474
StringBuilder clearBuf = new StringBuilder("DELETE FROM ");

‎plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private ServiceVirtualMachine createServiceVM(DataCenter zone, Account owner, Vi
134134
} catch (InsufficientCapacityException ex) {
135135
throw new CloudRuntimeException("Insufficient capacity", ex);
136136
}
137-
CallContext.current().setEventDetails("Vm Id: " + svm.getId());
137+
CallContext.current().setEventDetails("VM ID: " + svm.getId());
138138
return svm;
139139
}
140140

‎plugins/network-elements/stratosphere-ssp/src/test/java/org/apache/cloudstack/network/element/SspElementTest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void fullyConfigured() {
9090

9191
when(_element._physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetworkId, "StratosphereSsp")).thenReturn(nspvo);
9292

93-
// and zone api server, credentail is configured
93+
// and zone API server, credential is configured
9494
when(credential.getUsername()).thenReturn("foo");
9595
when(credential.getPassword()).thenReturn("bar");
9696

@@ -120,7 +120,7 @@ public void isReadyTest() {
120120
// ssp is ready
121121
assertTrue(_element.isReady(nspvo));
122122

123-
// If you don't call addstratospheressp api, ssp won't be ready
123+
// If you don't call addstratospheressp API, ssp won't be ready
124124
when(_element._sspCredentialDao.findByZone(dataCenterId.longValue())).thenReturn(null);
125125
when(_element._resourceMgr.listAllHostsInOneZoneByType(Host.Type.L2Networking, dataCenterId)).thenReturn(Arrays.<HostVO> asList());
126126
assertFalse(_element.isReady(nspvo));
@@ -133,7 +133,7 @@ public void canHandleTest() {
133133
// ssp is active
134134
assertTrue(_element.canHandle(psvo));
135135

136-
// You can disable ssp temporary by truning the state disabled
136+
// You can disable ssp temporary by turning the state disabled
137137
when(nspvo.getState()).thenReturn(PhysicalNetworkServiceProvider.State.Disabled);
138138
assertFalse(_element.canHandle(psvo));
139139

@@ -146,7 +146,7 @@ public void canHandleTest() {
146146
when(nspvo.getState()).thenReturn(PhysicalNetworkServiceProvider.State.Enabled);
147147
when(_element._physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetworkId, "StratosphereSsp")).thenReturn(nspvo);
148148

149-
// If you don't call addstratospheressp api, ssp won't be active
149+
// If you don't call addstratospheressp API, ssp won't be active
150150
when(_element._sspCredentialDao.findByZone(dataCenterId.longValue())).thenReturn(null);
151151
when(_element._resourceMgr.listAllHostsInOneZoneByType(Host.Type.L2Networking, dataCenterId)).thenReturn(Arrays.<HostVO> asList());
152152
assertFalse(_element.canHandle(psvo));

‎server/src/main/java/com/cloud/network/NetworkServiceImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4464,7 +4464,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
44644464
long vmId = nic.getInstanceId();
44654465
VMInstanceVO vm = _vmDao.findById(vmId);
44664466
if (vm == null) {
4467-
logger.error("Instance for NIC {} not found with Instance Id: {}", nic, vmId);
4467+
logger.error("Instance for NIC {} not found with Instance ID: {}", nic, vmId);
44684468
continue;
44694469
}
44704470
long isDefault = (nic.isDefaultNic()) ? 1 : 0;

‎server/src/main/java/com/cloud/template/TemplateManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ public boolean detachIso(long vmId, Long isoParamId, Boolean... extraParams) {
13921392
if (isoId == null) {
13931393
throw new InvalidParameterValueException("The specified instance has no ISO attached to it.");
13941394
}
1395-
CallContext.current().setEventDetails("Vm ID: " + virtualMachine.getUuid() + " ISO ID: " + isoId);
1395+
CallContext.current().setEventDetails("VM ID: " + virtualMachine.getUuid() + " ISO ID: " + isoId);
13961396

13971397
State vmState = virtualMachine.getState();
13981398
if (vmState != State.Running && vmState != State.Stopped) {

‎server/src/main/java/com/cloud/vm/UserVmManagerImpl.java‎

Lines changed: 237 additions & 238 deletions
Large diffs are not rendered by default.

‎server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2577,7 +2577,7 @@ public void validateIfVmHasNoRulesTestLoadBalancingRulesExistThrowsInvalidParame
25772577

25782578
@Test
25792579
public void validateIfVmHasNoRulesTestOneToOneNatRulesExistThrowsInvalidParameterValueException() {
2580-
String expectedMessage = String.format("Remove the One to One Nat rule for VM [%s] for IP [%s].", userVmVoMock, ipAddressVoMock.toString());
2580+
String expectedMessage = String.format("Remove the One to One NAT rule for VM [%s] for IP [%s].", userVmVoMock, ipAddressVoMock.toString());
25812581

25822582
LinkedList<IPAddressVO> ipAddressVoList = new LinkedList<>();
25832583

‎server/src/test/java/com/cloud/vm/UserVmManagerTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public void testScaleVMF1() throws Exception {
293293

294294
lenient().when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance);
295295

296-
// UserContext.current().setEventDetails("Vm Id: "+getId());
296+
// UserContext.current().setEventDetails("VM ID: "+getId());
297297
Account account = new AccountVO("testaccount", 1L, "networkdomain", Account.Type.NORMAL, "uuid");
298298
UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString(), User.Source.UNKNOWN);
299299
//AccountVO(String accountName, long domainId, String networkDomain, short type, int regionId)
@@ -405,7 +405,7 @@ public void testScaleVMF4() throws Exception {
405405
serviceOfferingIdField.setAccessible(true);
406406
serviceOfferingIdField.set(cmd, 1L);
407407

408-
//UserContext.current().setEventDetails("Vm Id: "+getId());
408+
//UserContext.current().setEventDetails("VM ID: "+getId());
409409
//Account account = (Account) new AccountVO("testaccount", 1L, "networkdomain", (short) 0, 1);
410410
//AccountVO(String accountName, long domainId, String networkDomain, short type, int regionId)
411411
//UserContext.registerContext(1, account, null, true);

‎systemvm/debian/opt/cloud/bin/setup/common.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ setup_dnsmasq() {
483483
then
484484
sed -i -e "/^[#]*dhcp-option.*=119.*$/d" /etc/dnsmasq.conf
485485
echo "dhcp-option-force=119,$DNS_SEARCH_ORDER" >> /etc/dnsmasq.conf
486-
# set the domain search order as a space seprated list for option 15
486+
# set the domain search order as a space separated list for option 15
487487
DNS_SEARCH_ORDER=$(echo $DNS_SEARCH_ORDER | sed 's/,/ /g')
488488
#send domain name to dhcp clients
489489
sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\""$DNS_SEARCH_ORDER"\"/ /etc/dnsmasq.conf
@@ -544,7 +544,7 @@ setup_dnsmasq() {
544544
[ $ETH0_IP ] && echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
545545
[ $ETH0_IP6 ] && echo "dhcp-option=option6:dns-server,$NS6" >> /etc/dnsmasq.conf
546546
#adding the name data-server to the /etc/hosts for allowing the access to user-data service and ssh-key reset in every subnet.
547-
#removing the existing entires to avoid duplicates on restarts.
547+
#removing the existing entries to avoid duplicates on restarts.
548548
sed -i '/data-server/d' /etc/hosts
549549
if [ -n "$ETH0_IP" ]
550550
then
@@ -736,7 +736,7 @@ parse_cmd_line() {
736736
KEY=$(echo $i | cut -d= -f1)
737737
VALUE=$(echo $i | cut -d= -f2)
738738
echo -en ${COMMA} >> ${CHEF_TMP_FILE}
739-
# Two lines so values do not accidentally interpretted as escapes!!
739+
# Two lines so values do not accidentally interpreted as escapes!!
740740
echo -n \"${KEY}\"': '\"${VALUE}\" >> ${CHEF_TMP_FILE}
741741
COMMA=",\n\t"
742742
case $KEY in

‎test/integration/component/maint/test_host_high_availability.py‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def tearDownClass(cls):
159159
try:
160160
# Remove the host from HA
161161
Host.update(cls.api_client, id=cls.hosts[2].id, hosttags="")
162-
#Cleanup resources used
162+
# Cleanup resources used
163163
cleanup_resources(cls.api_client, cls._cleanup)
164164
except Exception as e:
165165
raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -179,7 +179,7 @@ def setUp(self):
179179

180180
def tearDown(self):
181181
try:
182-
#Clean up, terminate the created accounts, domains etc
182+
# Clean up, terminate the created accounts, domains etc
183183
cleanup_resources(self.apiclient, self.cleanup)
184184
except Exception as e:
185185
raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -220,7 +220,7 @@ def test_01_vm_deployment_with_compute_offering_with_ha_enabled(self):
220220
"The service offering is not HA enabled"
221221
)
222222

223-
#create virtual machine with the service offering with Ha enabled
223+
# create virtual machine with the service offering with Ha enabled
224224
virtual_machine = VirtualMachine.create(
225225
self.apiclient,
226226
self.services["virtual_machine"],
@@ -253,7 +253,7 @@ def test_01_vm_deployment_with_compute_offering_with_ha_enabled(self):
253253
@attr(configuration="ha.tag")
254254
@attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"])
255255
def test_02_no_vm_creation_on_host_with_haenabled(self):
256-
""" Verify you can not create new VMs on hosts with an ha.tag """
256+
""" Verify you cannot create new VMs on hosts with an ha.tag """
257257

258258
# Steps,
259259
#1. Fresh install CS (Bonita) that supports this feature
@@ -296,7 +296,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self):
296296

297297
self.debug("Deployed VM on host: %s" % vm.hostid)
298298

299-
#validate the virtual machine created is host Ha enabled
299+
# validate the virtual machine created is host Ha enabled
300300
list_hosts_response = list_hosts(
301301
self.apiclient,
302302
id=vm.hostid
@@ -310,7 +310,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self):
310310
self.assertNotEqual(
311311
len(list_hosts_response),
312312
0,
313-
"listHosts retuned empty list in response."
313+
"listHosts returned empty list in response."
314314
)
315315

316316
self.assertEqual(
@@ -319,7 +319,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self):
319319
"VM created on HA enabled host."
320320
)
321321

322-
#create and verify virtual machine with Ha disabled service offering
322+
# create and verify virtual machine with Ha disabled service offering
323323
virtual_machine_without_ha = VirtualMachine.create(
324324
self.apiclient,
325325
self.services["virtual_machine"],
@@ -350,7 +350,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self):
350350

351351
self.debug("Deployed VM on host: %s" % vm.hostid)
352352

353-
#verify that the virtual machine created on the host is Ha disabled
353+
# verify that the virtual machine created on the host is Ha disabled
354354
list_hosts_response = list_hosts(
355355
self.apiclient,
356356
id=vm.hostid
@@ -378,7 +378,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self):
378378
@attr(configuration="ha.tag")
379379
@attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"])
380380
def test_03_cant_migrate_vm_to_host_with_ha_positive(self):
381-
""" Verify you can not migrate VMs to hosts with an ha.tag (positive) """
381+
""" Verify you cannot migrate VMs to hosts with an ha.tag (positive) """
382382

383383
# Steps,
384384
# 1. Create a Compute service offering with the 'Offer HA' option selected.
@@ -495,7 +495,7 @@ def test_03_cant_migrate_vm_to_host_with_ha_positive(self):
495495
@attr(configuration="ha.tag")
496496
@attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"])
497497
def test_04_cant_migrate_vm_to_host_with_ha_negative(self):
498-
""" Verify you can not migrate VMs to hosts with an ha.tag (negative) """
498+
""" Verify you cannot migrate VMs to hosts with an ha.tag (negative) """
499499

500500
# Steps,
501501
#1. Create a Compute service offering with the 'Offer HA' option selected.
@@ -539,7 +539,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self):
539539

540540
self.debug("Deployed VM on host: %s" % vm.hostid)
541541

542-
#Find out Non-Suitable host for VM migration
542+
# Find out Non-Suitable host for VM migration
543543
list_hosts_response = list_hosts(
544544
self.apiclient,
545545
type="Routing"
@@ -564,15 +564,15 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self):
564564

565565
self.assertTrue(notSuitableHost is not None, "notsuitablehost should not be None")
566566

567-
#Migrate VM to Non-Suitable host
567+
# Migrate VM to Non-Suitable host
568568
self.debug("Migrating VM-ID: %s to Host: %s" % (vm.id, notSuitableHost.id))
569569

570570
cmd = migrateVirtualMachine.migrateVirtualMachineCmd()
571571
cmd.hostid = notSuitableHost.id
572572
cmd.virtualmachineid = vm.id
573573
self.apiclient.migrateVirtualMachine(cmd)
574574

575-
#Verify that the virtual machine got migrated to targeted Non-Suitable host
575+
# Verify that the virtual machine got migrated to targeted Non-Suitable host
576576
list_vm_response = list_virtual_machines(
577577
self.apiclient,
578578
id=vm.id
@@ -598,7 +598,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self):
598598
self.assertEqual(
599599
list_vm_response[0].hostid,
600600
notSuitableHost.id,
601-
"The detination host id of migrated VM is not matching."
601+
"The destination host id of migrated VM is not matching."
602602
)
603603

604604
@attr(configuration="ha.tag")
@@ -650,7 +650,7 @@ def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self):
650650

651651
vm_with_ha_enabled = vms[0]
652652

653-
#Verify the virtual machine got created on non HA host
653+
# Verify the virtual machine got created on non HA host
654654
list_hosts_response = list_hosts(
655655
self.apiclient,
656656
id=vm_with_ha_enabled.hostid
@@ -673,15 +673,15 @@ def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self):
673673
"The virtual machine is not ha enabled so check if VM is created on host which is also not ha enabled"
674674
)
675675

676-
#put the Host in maintenance mode
676+
# put the Host in maintenance mode
677677
self.debug("Enabling maintenance mode for host %s" % vm_with_ha_enabled.hostid)
678678
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
679679
cmd.id = vm_with_ha_enabled.hostid
680680
self.apiclient.prepareHostForMaintenance(cmd)
681681

682682
timeout = self.services["timeout"]
683683

684-
#verify the VM live migration happened to another running host
684+
# verify the VM live migration happened to another running host
685685
self.debug("Waiting for VM to come up")
686686
time.sleep(timeout)
687687

@@ -781,7 +781,7 @@ def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self):
781781

782782
vm_with_ha_disabled = vms[0]
783783

784-
#Verify the virtual machine got created on non HA host
784+
# Verify the virtual machine got created on non HA host
785785
list_hosts_response = list_hosts(
786786
self.apiclient,
787787
id=vm_with_ha_disabled.hostid
@@ -804,15 +804,15 @@ def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self):
804804
"The virtual machine is not ha enabled so check if VM is created on host which is also not ha enabled"
805805
)
806806

807-
#put the Host in maintenance mode
807+
# put the Host in maintenance mode
808808
self.debug("Enabling maintenance mode for host %s" % vm_with_ha_disabled.hostid)
809809
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
810810
cmd.id = vm_with_ha_disabled.hostid
811811
self.apiclient.prepareHostForMaintenance(cmd)
812812

813813
timeout = self.services["timeout"]
814814

815-
#verify the VM live migration happened to another running host
815+
# verify the VM live migration happened to another running host
816816
self.debug("Waiting for VM to come up")
817817
time.sleep(timeout)
818818

0 commit comments

Comments
 (0)