This is an automated email from the ASF dual-hosted git repository. bhaisaab pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 4760eac6a877312fd9fcdfe786d7436e9537020a Author: Rohit Yadav <[email protected]> AuthorDate: Mon Nov 27 19:33:20 2017 +0530 fix blocker, cyclical imports, several UI fixes Signed-off-by: Rohit Yadav <[email protected]> --- .../schema/src/com/cloud/user/UserAccountVO.java | 4 + engine/schema/src/com/cloud/user/UserVO.java | 4 + .../debian/config/opt/cloud/bin/configure.py | 2 +- .../config/opt/cloud/bin/cs/CsStaticRoutes.py | 1 + test/integration/smoke/test_list_ids_parameter.py | 70 ++++++++--------- test/integration/smoke/test_router_dns.py | 2 +- test/integration/smoke/test_router_dnsservice.py | 16 ++-- ui/l10n/en.js | 1 + ui/scripts/sharedFunctions.js | 2 +- ui/scripts/system.js | 90 +++++++++++++++++++--- 10 files changed, 136 insertions(+), 56 deletions(-) diff --git a/engine/schema/src/com/cloud/user/UserAccountVO.java b/engine/schema/src/com/cloud/user/UserAccountVO.java index 5ce0eb7..2ad2ae0 100644 --- a/engine/schema/src/com/cloud/user/UserAccountVO.java +++ b/engine/schema/src/com/cloud/user/UserAccountVO.java @@ -33,6 +33,7 @@ import org.apache.cloudstack.api.InternalIdentity; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; +import com.google.common.base.Strings; @Entity @Table(name = "user") @@ -257,6 +258,9 @@ public class UserAccountVO implements UserAccount, InternalIdentity { @Override public String getTimezone() { + if (Strings.isNullOrEmpty(timezone)) { + return "UTC"; + } return timezone; } diff --git a/engine/schema/src/com/cloud/user/UserVO.java b/engine/schema/src/com/cloud/user/UserVO.java index da7811e..d6ddb58 100644 --- a/engine/schema/src/com/cloud/user/UserVO.java +++ b/engine/schema/src/com/cloud/user/UserVO.java @@ -34,6 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity; import com.cloud.user.Account.State; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; +import com.google.common.base.Strings; /** * A bean representing a user @@ -233,6 +234,9 @@ public class UserVO implements User, Identity, InternalIdentity { @Override public String getTimezone() { + if (Strings.isNullOrEmpty(timezone)) { + return "UTC"; + } return timezone; } diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py index 3d81b81..9a09f9b 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py @@ -31,8 +31,8 @@ import os.path import os from fcntl import flock, LOCK_EX, LOCK_UN +import cs.CsHelper as CsHelper from cs.CsDatabag import CsDataBag, CsCmdLine -import cs.CsHelper from cs.CsNetfilter import CsNetfilters from cs.CsDhcp import CsDhcp from cs.CsFile import CsFile diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py index 519f5ee..df98b2e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py @@ -17,6 +17,7 @@ # specific language governing permissions and limitations # under the License. +import logging import CsHelper from CsDatabag import CsDataBag diff --git a/test/integration/smoke/test_list_ids_parameter.py b/test/integration/smoke/test_list_ids_parameter.py index f679aed..cc45ce3 100755 --- a/test/integration/smoke/test_list_ids_parameter.py +++ b/test/integration/smoke/test_list_ids_parameter.py @@ -105,20 +105,20 @@ class TestListIdsParams(cloudstackTestCase): mode=cls.services["mode"] ) - #Take 3 VM1 Snapshots - #PLEASE UNCOMMENT ONCE VM SNAPSHOT DELAY BUG AFTER VM CREATION IS FIXED - """cls.vmsnapshot_1 = VmSnapshot.create( - cls.apiclient, - cls.virtual_machine_1.id - ) - cls.vmsnapshot_2 = VmSnapshot.create( - cls.apiclient, - cls.virtual_machine_1.id - ) - cls.vmsnapshot_3 = VmSnapshot.create( - cls.apiclient, - cls.virtual_machine_1.id - )""" +# Take 3 VM1 Snapshots +# PLEASE UNCOMMENT ONCE VM SNAPSHOT DELAY BUG AFTER VM CREATION IS FIXED +# cls.vmsnapshot_1 = VmSnapshot.create( +# cls.apiclient, +# cls.virtual_machine_1.id +# ) +# cls.vmsnapshot_2 = VmSnapshot.create( +# cls.apiclient, +# cls.virtual_machine_1.id +# ) +# cls.vmsnapshot_3 = VmSnapshot.create( +# cls.apiclient, +# cls.virtual_machine_1.id +# ) #Stop VMs cls.virtual_machine_1.stop(cls.apiclient) @@ -229,7 +229,7 @@ class TestListIdsParams(cloudstackTestCase): 3, "ListVolumes response expected 3 Volumes, received %s" % len(list_volume_response) ) - + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") def test_02_list_templates(self): """Test listing Templates using 'ids' parameter @@ -273,23 +273,23 @@ class TestListIdsParams(cloudstackTestCase): "ListSnapshots response expected 3 Snapshots, received %s" % len(list_snapshot_response) ) - #PLEASE UNCOMMENT ONCE VM SNAPSHOT DELAY BUG AFTER VM CREATION IS FIXED - #@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") - #def test_04_list_vm_snapshots(self): - """Test listing VMSnapshots using 'vmsnapshotids' parameter - """ - """list_vm_snapshot_response = VmSnapshot.list( - self.apiclient, - vmsnapshotids=[self.vmsnapshot_1.id, self.vmsnapshot_2.id, self.vmsnapshot_3.id], - listall=True - ) - self.assertEqual( - isinstance(list_vm_snapshot_response, list), - True, - "ListVMSnapshots response was not a valid list" - ) - self.assertEqual( - len(list_vm_snapshot_response), - 3, - "ListVMSnapshots response expected 3 VMSnapshots, received %s" % len(list_vm_snapshot_response) - )""" +# PLEASE UNCOMMENT ONCE VM SNAPSHOT DELAY BUG AFTER VM CREATION IS FIXED +# @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") +# def test_04_list_vm_snapshots(self): +# """Test listing VMSnapshots using 'vmsnapshotids' parameter +# """ +# list_vm_snapshot_response = VmSnapshot.list( +# self.apiclient, +# vmsnapshotids=[self.vmsnapshot_1.id, self.vmsnapshot_2.id, self.vmsnapshot_3.id], +# listall=True +# ) +# self.assertEqual( +# isinstance(list_vm_snapshot_response, list), +# True, +# "ListVMSnapshots response was not a valid list" +# ) +# self.assertEqual( +# len(list_vm_snapshot_response), +# 3, +# "ListVMSnapshots response expected 3 VMSnapshots, received %s" % len(list_vm_snapshot_response) +# ) diff --git a/test/integration/smoke/test_router_dns.py b/test/integration/smoke/test_router_dns.py index ef77224..9b4ca7e 100644 --- a/test/integration/smoke/test_router_dns.py +++ b/test/integration/smoke/test_router_dns.py @@ -256,7 +256,7 @@ class TestRouterDns(cloudstackTestCase): result = None try: self.logger.debug("SSH into guest VM with IP: %s" % nat_rule1.ipaddress) - ssh = self.vm.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=8) + ssh = self.vm.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=15) result = str(ssh.execute("nslookup google.com")) except Exception as e: self.fail("Failed to SSH into VM - %s due to exception: %s" % (nat_rule1.ipaddress, e)) diff --git a/test/integration/smoke/test_router_dnsservice.py b/test/integration/smoke/test_router_dnsservice.py index 436d9e4..ffadec7 100644 --- a/test/integration/smoke/test_router_dnsservice.py +++ b/test/integration/smoke/test_router_dnsservice.py @@ -92,8 +92,8 @@ class TestRouterDnsService(cloudstackTestCase): zoneid=cls.zone.id) cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id)) - cls.services["virtual_machine"]["displayname"] = VM1_NAME; - cls.services["virtual_machine"]["name"] = VM1_NAME; + cls.services["virtual_machine"]["displayname"] = VM1_NAME + cls.services["virtual_machine"]["name"] = VM1_NAME cls.vm1 = VirtualMachine.create(cls.api_client, cls.services["virtual_machine"], templateid=cls.template.id, @@ -102,10 +102,10 @@ class TestRouterDnsService(cloudstackTestCase): serviceofferingid=cls.service_offering.id, networkids=[str(cls.network.id)]) cls.vm1.password = "password" - cls.logger.debug("Created VM named %s" % VM1_NAME); - - cls.services["virtual_machine"]["displayname"] = VM2_NAME; - cls.services["virtual_machine"]["name"] = VM2_NAME; + cls.logger.debug("Created VM named %s" % VM1_NAME) + + cls.services["virtual_machine"]["displayname"] = VM2_NAME + cls.services["virtual_machine"]["name"] = VM2_NAME cls.vm2 = VirtualMachine.create(cls.api_client, cls.services["virtual_machine"], templateid=cls.template.id, @@ -114,7 +114,7 @@ class TestRouterDnsService(cloudstackTestCase): serviceofferingid=cls.service_offering.id, networkids=[str(cls.network.id)]) cls.vm2.password = "password" - cls.logger.debug("Created VM named %s" % VM2_NAME); + cls.logger.debug("Created VM named %s" % VM2_NAME) cls.services["natrule1"] = { "privateport": 22, @@ -256,7 +256,7 @@ class TestRouterDnsService(cloudstackTestCase): result1 = None try: self.logger.debug("SSH into guest VM with IP: %s" % nat_rule1.ipaddress) - ssh = self.vm1.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=8) + ssh = self.vm1.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=15) result1 = str(ssh.execute("nslookup %s" % VM1_NAME)) self.logger.debug("nslookup %s: %s " % (VM1_NAME, result1)) result2 = str(ssh.execute("nslookup %s" % VM2_NAME)) diff --git a/ui/l10n/en.js b/ui/l10n/en.js index 3d0c421..9f5b1a5 100644 --- a/ui/l10n/en.js +++ b/ui/l10n/en.js @@ -556,6 +556,7 @@ var dictionary = {"ICMP.code":"ICMP Code", "label.console.proxy.vm":"Console Proxy VM", "label.continue":"Continue", "label.continue.basic.install":"Continue with basic installation", +"label.control.ip":"Control IP", "label.copying.iso":"Copying ISO", "label.corrections.saved":"Corrections saved", "label.counter":"Counter", diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 655aee9..94a8743 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1028,7 +1028,7 @@ cloudStack.converters = { var disconnected = new Date(); disconnected.setISO8601(UtcDate); - if (g_timezoneoffset != null) { + if (g_timezoneoffset != null && g_timezoneoffset != "null") { localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset); } else { var browserDate = new Date(); diff --git a/ui/scripts/system.js b/ui/scripts/system.js index fc9b4b8..ba9b8b0 100755 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -39,7 +39,7 @@ router.guestnetworkname = router.vpcname; } - if ("isredundantrouter" in router && router.isredundantrouter) { + if (router.isredundantrouter) { router.guestnetworkname = router.guestnetworkname + " (" + router.redundantstate + ")"; } @@ -2082,6 +2082,12 @@ }, isolationmethods: { label: 'label.isolation.method' + }, + vlan: { + label: 'label.vlan' + }, + broadcastdomainrange: { + label: 'label.broadcast.domain.range' } }, @@ -9107,6 +9113,14 @@ data: data, success: function (json) { var systemvmObjs = json.listsystemvmsresponse.systemvm; + $(systemvmObjs).each(function(idx, item) { + var controlIp = item.linklocalip; + if (item.hypervisor == "VMware") { + var controlIp = item.privateip; + } + item.controlip = controlIp; + }); + if (systemvmObjs != undefined) { $.ajax({ url: createURL('listHosts'), @@ -9487,16 +9501,19 @@ label: 'label.name' }, publicip: { - label: 'label.public.ip' + label: 'label.ip' }, - account: { - label: 'label.account' + routerType: { + label: 'label.type' }, guestnetworkname: { label: 'label.network' }, - routerType: { - label: 'label.type' + account: { + label: 'label.account' + }, + hostname: { + label: 'label.host' }, state: { converter: function (str) { @@ -10878,6 +10895,12 @@ return args; } }, + controlip: { + label: 'label.control.ip' + }, + hostname: { + label: 'label.host' + }, zonename: { label: 'label.zone' }, @@ -13195,12 +13218,19 @@ netmask: { label: 'label.netmask' }, + zonename: { + label: 'label.zone' + }, allocationstate: { converter: function (str) { // For localization return str; }, - label: 'label.allocation.state' + label: 'label.allocation.state', + indicator: { + 'Enabled': 'on', + 'Disabled': 'off' + } } }, @@ -13852,12 +13882,15 @@ name: { label: 'label.name' }, - podname: { - label: 'label.pod' - }, hypervisortype: { label: 'label.hypervisor' }, + zonename: { + label: 'label.zone' + }, + podname: { + label: 'label.pod' + }, //allocationstate: { label: 'label.allocation.state' }, //managedstate: { label: 'Managed State' }, allocationstate: { @@ -15405,6 +15438,12 @@ name: { label: 'label.name' }, + ipaddress: { + label: 'label.ip.address' + }, + hypervisor: { + label: 'label.hypervisor' + }, zonename: { label: 'label.zone' }, @@ -17415,12 +17454,34 @@ label: 'label.path', truncate: true }, + type: { + label: 'label.type' + }, clustername: { label: 'label.cluster', truncate: true }, scope: { label: 'label.scope' + }, + zonename: { + label: 'label.zone' + }, + state: { + label: 'label.state', + converter: function (str) { + // For localization + return str; + }, + indicator: { + 'Up': 'on', + 'Down': 'off', + 'Removed': 'off', + 'ErrorInMaintenance': 'off', + 'PrepareForMaintenance': 'transition', + 'CancelMaintenance': 'warning', + 'Maintenance': 'warning', + } } }, @@ -19401,8 +19462,17 @@ name: { label: 'label.name' }, + url: { + label: 'label.url' + }, protocol: { label: 'label.protocol' + }, + scope: { + label: 'label.scope' + }, + zonename: { + label: 'label.zone' } }, -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
