[cloudstack-documentation] 04/21: wording and header corrections
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 4d004f83c91fadd8cf1598d0da4013d235f16672 Author: ernjvr AuthorDate: Tue Aug 28 15:39:10 2018 +0200 wording and header corrections --- .../networking/additional_networking_features.rst | 91 -- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/source/adminguide/networking/additional_networking_features.rst b/source/adminguide/networking/additional_networking_features.rst index c15aa46..41d9690 100644 --- a/source/adminguide/networking/additional_networking_features.rst +++ b/source/adminguide/networking/additional_networking_features.rst @@ -13,97 +13,104 @@ specific language governing permissions and limitations under the License. - +## Additional Networking Features - +## +*** KVM Libvirt Hook Script Include -~~~ +*** -**Feature Overview**: +Feature Overview: += - This feature applies to KVM hosts. - KVM utilised under CloudStack uses the standard Libvirt hook script behaviour outlined in https://libvirt.org/hooks.html. -- During the install of the KVM CloudStack agent, the script "/etc/libvirt/hooks/qemu" is populated based on the CloudStack-provided file "libvirtqemuhook.in". -- This is a python script that carries out network management tasks every time a VM is started, stopped or migrated, as per the qemu script specification. -- User-specific network configuration tasks can be done at the same time as the "/etc/libvirt/hooks/qemu" is called. -- Since the tasks in question are user-specific, they cannot be included in the CloudStack-provided script. +- During the install of the KVM CloudStack agent, the Libvirt hook script "/etc/libvirt/hooks/qemu", referred to as the qemu script hereafter is installed. +- This is a python script that carries out network management tasks every time a VM is started, stopped or migrated, as per the Libvirt hooks specification. +- Custom network configuration tasks can be done at the same time as the qemu script is called. +- Since the tasks in question are user-specific, they cannot be included in the CloudStack-provided qemu script. -- The Libvirt documentation page https://libvirt.org/hooks.html#qemu describes the parameters that can be passed to the "qemu" script, based on what actions KVM and Libvirt are carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 'migrate', 'restore', 'reconnect' and 'attach'. +- The Libvirt documentation page https://libvirt.org/hooks.html#qemu describes the parameters that can be passed to the qemu script, based on what actions KVM and Libvirt are carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 'migrate', 'restore', 'reconnect' and 'attach'. -**The KVM Libvirt Hook script allows for**: +The KVM Libvirt Hook script allows for: +=== -#. The inclusion and execution of user-specific scripts to perform additional networking configuration tasks. -#. The included user-specific scripts can be bash scripts and/or python scripts. -#. Each script's start-up and return commands are captured and logged. -#. There are no limits to the number of user-specific scripts that can be included or called. +#. The inclusion and execution of custom scripts to perform additional networking configuration tasks. +#. The included custom scripts can be bash scripts and/or python scripts. +#. Each custom script's start-up and return commands are captured and logged. +#. There are no limits to the number of custom scripts that can be included or called. -**Usage**: +Usage: +== - -- The cloudstack-agent package will install the libvirtqemuhook.in script in the /etc/libvirt/hooks directory of Libvirt and rename the script to "qemu". -- The documentation page: https://libvirt.org/hooks.html#arguments describes the arguments that can be passed to the "qemu" script. +- The cloudstack-agent package will install the qemu script in the /etc/libvirt/hooks directory of Libvirt. +- The documentation page: https://libvirt.org/hooks.html#arguments describes the arguments that can be passed to the qemu script. - The input arguments are: #. Name of the object involved in the operation, or '-' if there is none. For example, the name of a guest being started. -#. Name of the operation being perfor
[cloudstack-documentation] 05/21: links footnotes added
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 24cb4dbc21e5937170541315349a0b6156015e18 Author: ernjvr AuthorDate: Tue Aug 28 16:35:52 2018 +0200 links footnotes added --- .../adminguide/networking/additional_networking_features.rst | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/adminguide/networking/additional_networking_features.rst b/source/adminguide/networking/additional_networking_features.rst index 41d9690..bb14a26 100644 --- a/source/adminguide/networking/additional_networking_features.rst +++ b/source/adminguide/networking/additional_networking_features.rst @@ -25,13 +25,13 @@ Feature Overview: = - This feature applies to KVM hosts. -- KVM utilised under CloudStack uses the standard Libvirt hook script behaviour outlined in https://libvirt.org/hooks.html. +- KVM utilised under CloudStack uses the standard Libvirt hook script behaviour as outlined in the Libvirt documentation page `hooks`_. - During the install of the KVM CloudStack agent, the Libvirt hook script "/etc/libvirt/hooks/qemu", referred to as the qemu script hereafter is installed. - This is a python script that carries out network management tasks every time a VM is started, stopped or migrated, as per the Libvirt hooks specification. - Custom network configuration tasks can be done at the same time as the qemu script is called. - Since the tasks in question are user-specific, they cannot be included in the CloudStack-provided qemu script. -- The Libvirt documentation page https://libvirt.org/hooks.html#qemu describes the parameters that can be passed to the qemu script, based on what actions KVM and Libvirt are carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 'migrate', 'restore', 'reconnect' and 'attach'. +- The Libvirt documentation page `qemu`_ describes the parameters that can be passed to the qemu script, based on what actions KVM and Libvirt are carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 'migrate', 'restore', 'reconnect' and 'attach'. The KVM Libvirt Hook script allows for: === @@ -45,7 +45,7 @@ Usage: == - The cloudstack-agent package will install the qemu script in the /etc/libvirt/hooks directory of Libvirt. -- The documentation page: https://libvirt.org/hooks.html#arguments describes the arguments that can be passed to the qemu script. +- The Libvirt documentation page `arguments`_ describes the arguments that can be passed to the qemu script. - The input arguments are: #. Name of the object involved in the operation, or '-' if there is none. For example, the name of a guest being started. @@ -114,3 +114,7 @@ Custom Script Execution Configuration: - In shell custom scripts include #!/bin/bash in the first line of the file so that the script will be executed with bash. - In Python custom scripts include #!/usr/bin/python in the first line of the file so that the script will be executed with python. + +.. _`hooks`: https://libvirt.org/hooks.html +.. _`qemu`: https://libvirt.org/hooks.html#qemu +.. _`arguments`: https://libvirt.org/hooks.html#arguments
[cloudstack-documentation] 17/21: systemvmtemplate: use other 64-bit linux for vmware
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 920c8f52001b9f90d9f640f0de222001f246524b Author: Rohit Yadav AuthorDate: Thu Nov 22 12:43:47 2018 +0530 systemvmtemplate: use other 64-bit linux for vmware Signed-off-by: Rohit Yadav --- source/upgrading/upgrade/_sysvm_templates.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/upgrading/upgrade/_sysvm_templates.rst b/source/upgrading/upgrade/_sysvm_templates.rst index 9321a47..53167ee 100644 --- a/source/upgrading/upgrade/_sysvm_templates.rst +++ b/source/upgrading/upgrade/_sysvm_templates.rst @@ -101,7 +101,7 @@ Update System-VM templates ||| || Format: OVA| ||| - || OS Type: Other Linux 64-bit (or Debian 8.0 or 9.0 64-bit) | + || OS Type: Other Linux 64-bit| ||| || Extractable: no| |||
[cloudstack-documentation] 12/21: bridge section was missing (#12)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit cfc18dffa6f18996529e7b0bcfe04d78105c03f2 Author: Andrija Panic AuthorDate: Wed Nov 7 14:02:47 2018 +0100 bridge section was missing (#12) network setup was completely missing the bridge sections - so added it. --- source/quickinstallationguide/qig.rst | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/source/quickinstallationguide/qig.rst b/source/quickinstallationguide/qig.rst index a45962b..2ce77f3 100644 --- a/source/quickinstallationguide/qig.rst +++ b/source/quickinstallationguide/qig.rst @@ -104,27 +104,43 @@ Connecting via the console you should login as root. Check the file Unfortunately, this configuration will not permit you to connect to the network, and is also unsuitable for our purposes with CloudStack. We want to -configure that file so that it specifies the IP address, netmask, etc., as -shown in the following example: +configure that file so that it specifies the IP address, netmask, etc. We will +edit the eth0 interface and make it part of bridge named "cloudbr0" as shown in the +following example: .. note:: You should not use the Hardware Address (aka the MAC address) from our example for your configuration. It is network interface specific, so you should keep the address already provided in the HWADDR directive. +vi /etc/sysconfig/network-scripts/ifcfg-eth0 :: DEVICE=eth0 - HWADDR=52:54:00:B9:A6:C0 - NM_CONTROLLED=no + HWADDR=00:04:xx:xx:xx:xx ONBOOT=yes BOOTPROTO=none + TYPE=Ethernet + BRIDGE=cloudbr0 + +vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0 + +:: + + DEVICE=cloudbr0 + TYPE=Bridge + ONBOOT=yes + BOOTPROTO=none + IPV6INIT=no + IPV6_AUTOCONF=no + DELAY=5 IPADDR=172.16.10.2 NETMASK=255.255.255.0 GATEWAY=172.16.10.1 DNS1=8.8.8.8 DNS2=8.8.4.4 - + STP=yes + .. note:: IP Addressing - Throughout this document we are assuming that you will have a /24 network for your CloudStack implementation. This can be any RFC 1918
[cloudstack-documentation] 18/21: Update Quick Installation Guide (#13)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 3a6862ab420c9bd3c4d7cd8476fc51eec82084ad Author: AlexBeez <44407345+alexb...@users.noreply.github.com> AuthorDate: Fri Nov 23 12:16:21 2018 -0500 Update Quick Installation Guide (#13) * Update qig.rst Updated to CentOS7, fixed networking to reflect required configuration * Updates to the cloubr0 configuration * Added instructions to disable firewall * Fixing ethernet device configuration segment * Simplify default ethernet device configuration. * fix systemvm version to 4.11.1 --- source/quickinstallationguide/qig.rst | 186 +- 1 file changed, 95 insertions(+), 91 deletions(-) diff --git a/source/quickinstallationguide/qig.rst b/source/quickinstallationguide/qig.rst index 2ce77f3..b0f218e 100644 --- a/source/quickinstallationguide/qig.rst +++ b/source/quickinstallationguide/qig.rst @@ -1,6 +1,6 @@ .. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - distributed with this work for additional information# + distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance @@ -34,7 +34,7 @@ High level overview of the process ~~ This runbook will focus on building a CloudStack cloud using KVM on CentOS -6.8 with NFS storage on a flat layer-2 network utilizing layer-3 network +7.5 with NFS storage on a flat layer-2 network utilizing layer-3 network isolation (aka Security Groups), and doing it all on a single piece of hardware. @@ -53,8 +53,8 @@ To complete this runbook you'll need the following items: #. At least one computer which supports and has enabled hardware virtualization. -#. The `CentOS 6.8 x86_64 minimal install CD - <http://mirrors.kernel.org/centos/6/isos/x86_64/>`_ +#. An `CentOS 7.5 x86_64 install ISO, on bootable media + <http://mirrors.kernel.org/centos/7/isos/x86_64/>`_ #. A /24 network with the gateway being at xxx.xxx.xxx.1, no DHCP should be on this network and none of the computers running CloudStack will have a @@ -71,14 +71,23 @@ CloudStack. We will go over the steps to prepare now. Operating System -Using the CentOS 6.8 x86_64 minimal install ISO, you'll need to install CentOS 6 +Using the CentOS 7.5 x86_64 install ISO, you'll need to install CentOS 7 on your hardware. The defaults will generally be acceptable for this -installation. +installation. You may want to configure network configuration during +setup - either using the guidelines below, or using a standard access +configuration which we will modify later. -Once this installation is complete, you'll want to connect to your freshly -installed machine via SSH as the root user. Note that you should not allow -root logins in a production environment, so be sure to turn off remote logins -once you have finished the installation and configuration. +Once this installation is complete, you'll want to gain access to your +server - through SSH (if network is configured) or connected peripherals. +Note that you should not allow remote root logins in a production +environment, so be sure to turn off this feature once the installation +and configuration is complete. + +If your network interface was configured to grant the server internet +access, it is always wise to update the system before starting: + +.. parsed-literal:: + # yum -y upgrade .. _conf-network: @@ -86,76 +95,76 @@ once you have finished the installation and configuration. Configuring the network ^^^ -By default the network will not come up on your hardware and you will need to -configure it to work in your environment. Since we specified that there will -be no DHCP server in this environment we will be manually configuring your -network interface. We will assume, for the purposes of this exercise, that -eth0 is the only network interface that will be connected and used. - -Connecting via the console you should login as root. Check the file -/etc/sysconfig/network-scripts/ifcfg-eth0, it will look like this by default: - -:: - - DEVICE="eth0" - HWADDR="52:54:00:B9:A6:C0" - NM_CONTROLLED="yes" - ONBOOT="no" +Unless you have configured it during install, which will not be covered by +this guide, the network interface will not come up on your hardware and you +will need to configure it to work in your environment. Since we specified +that there will be no DHCP server in this environment we will be
[cloudstack-documentation] 13/21: "yes" for KVM network throtling support (#11)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit b44f390e4d15174fe0c76b6225e44977c59ec6bd Author: Andrija Panic AuthorDate: Wed Nov 7 14:06:49 2018 +0100 "yes" for KVM network throtling support (#11) KVM does support it --- source/conceptsandterminology/choosing_deployment_architecture.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/conceptsandterminology/choosing_deployment_architecture.rst b/source/conceptsandterminology/choosing_deployment_architecture.rst index b3a9dec..a218193 100644 --- a/source/conceptsandterminology/choosing_deployment_architecture.rst +++ b/source/conceptsandterminology/choosing_deployment_architecture.rst @@ -168,7 +168,7 @@ supported by CloudStack. The following table provides this information. +--+---+--++-+++ | Feature | XenServer | vSphere | KVM - RHEL | LXC | HyperV | Bare Metal | +==+===+==++=+++ -| Network Throttling | Yes | Yes | No | No | ? | N/A| +| Network Throttling | Yes | Yes | Yes| No | ? | N/A| +--+---+--++-+++ | Security groups in zones that use| Yes | No | Yes| Yes | ? | No | | basic networking | | || |||
[cloudstack-documentation] 07/21: remove licence
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 1d12b1c05479f1996a79d64547b7a3fa0501c19a Author: ernjvr AuthorDate: Fri Aug 31 10:31:34 2018 +0200 remove licence --- source/adminguide/hosts.rst | 15 --- 1 file changed, 15 deletions(-) diff --git a/source/adminguide/hosts.rst b/source/adminguide/hosts.rst index 41a88a3..9693f55 100644 --- a/source/adminguide/hosts.rst +++ b/source/adminguide/hosts.rst @@ -746,21 +746,6 @@ to listen on default port 16514, and the port to be allowed in the firewall rules. Certificate renewal (using the ``provisionCertificate`` API) will restart both the libvirtd process and agent after deploying new certificates. -.. Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information# - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - KVM Libvirt Hook Script Include
[cloudstack-documentation] 02/21: per domain configs
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit c90753551314b6d776633d569af8ad190727f6db Author: Daan Hoogland AuthorDate: Mon Aug 20 07:27:20 2018 + per domain configs --- source/adminguide/accounts.rst | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/adminguide/accounts.rst b/source/adminguide/accounts.rst index 3fbc97f..699ee15 100644 --- a/source/adminguide/accounts.rst +++ b/source/adminguide/accounts.rst @@ -279,15 +279,19 @@ or ApacheDS to authenticate CloudStack end-users. CloudStack will search the external LDAP directory tree starting at a specified base directory and gets user info such as first name, last name, email and username. +Starting with CloudStack 4.11, an ldap connection per domain can be +defined. + To authenticate, username and password entered by the user are used. Cloudstack does a search for a user with the given username. If it exists, it does a bind request with DN and password. To set up LDAP authentication in CloudStack, call the CloudStack API command ``addLdapConfiguration`` and provide Hostname or IP address -and listening port of the LDAP server. You could configure multiple -servers as well. These are expected to be replicas. If one fails, -the next one is used. +and listening port of the LDAP server. Optionally a domain id can be +given for the domain for which this LDP connection is valid. You could +configure multiple servers as well. These are expected to be +replicas. If one fails, the next one is used. The following global configurations should also be configured (the default values are for openldap)
[cloudstack-documentation] 11/21: Merge pull request #9 from andrijapanic/patch-1
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git commit 2b7f8e9e4e4a48b3ba96a497c431c56129395801 Merge: ecf451c ddc2485 Author: Paul Angus AuthorDate: Sun Oct 14 09:41:22 2018 +0100 Merge pull request #9 from andrijapanic/patch-1 Formating fix to show code source/installguide/optional_installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[cloudstack-documentation] branch master updated (99637bf -> 998803a)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git. from 99637bf source/developersguide: removed extra http:// (#23) new 3a6862a Update Quick Installation Guide (#13) new d61d226 Updated the linux password script location (#25) new 6307766 Update requirements for Ubuntu 18.04 (#22) new 998803a Merge remote-tracking branch 'origin/4.11' The 54 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: source/installguide/building_from_source.rst | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-)
[cloudstack-cloudmonkey] branch master updated (c1185a5 -> d8cfcf7)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git. from c1185a5 cli: in case of no possible arg values, return empty string new 1a23c01 Makefile: emit build for arm32 (raspberrypi) new d8cfcf7 vendor: fix issue in readline option selector The 370 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: Makefile | 2 +- vendor/github.com/chzyer/readline/complete.go | 13 + 2 files changed, 10 insertions(+), 5 deletions(-)
[cloudstack-cloudmonkey] branch master updated: Makefile: emit builds for various platforms and architectures
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new 603425f Makefile: emit builds for various platforms and architectures 603425f is described below commit 603425f547eca91ddd1f8c3a1744566b43dcca1e Author: Rohit Yadav AuthorDate: Tue Jan 29 12:12:13 2019 +0530 Makefile: emit builds for various platforms and architectures Signed-off-by: Rohit Yadav --- Makefile | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0a0beca..92a8885 100644 --- a/Makefile +++ b/Makefile @@ -51,10 +51,13 @@ debug: dist: all rm -fr dist mkdir -p dist - GOOS=linux GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.amd64 cmk.go + GOOS=linux GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86-64 cmk.go + GOOS=linux GOARCH=386 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86 cmk.go GOOS=linux GOARCH=arm $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm32 cmk.go - GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.exe cmk.go - GOOS=darwin GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.amd64 cmk.go + GOOS=linux GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm64 cmk.go + GOOS=windows GOARCH=386 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86.exe cmk.go + GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86-64.exe cmk.go + GOOS=darwin GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.x86-64 cmk.go # Tools
[cloudstack-documentation] branch security-tls-config updated: the tls ciphers bug was fixed, remove unnecessary doc
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git The following commit(s) were added to refs/heads/security-tls-config by this push: new bed67ed the tls ciphers bug was fixed, remove unnecessary doc bed67ed is described below commit bed67ed924ebacfea9b93a2f9254e64e7d67de18 Author: Rohit Yadav AuthorDate: Tue Feb 5 13:26:57 2019 +0530 the tls ciphers bug was fixed, remove unnecessary doc Signed-off-by: Rohit Yadav --- source/installguide/optional_installation.rst | 16 1 file changed, 16 deletions(-) diff --git a/source/installguide/optional_installation.rst b/source/installguide/optional_installation.rst index c512bb1..8e1617f 100644 --- a/source/installguide/optional_installation.rst +++ b/source/installguide/optional_installation.rst @@ -113,22 +113,6 @@ server.properties file at /etc/cloudstack/management/ location: For storing certificates, admins can create and configure a java keystore file and configure the same in the server.properties file as illustrated above. -Disable Vulnerable TLS Algorithms -- - -The default JRE installation used for the CloudStack management server can be -configured to disable vulnerable TLS algorithms such as TLSv1, TLSv1.1 etc. -To do this, you can define or override the jdk.tls.disabledAlgorithms setting -in the JRE's java.security file typically at -$JRE_HOME/lib/security/java.security: - - .. parsed-literal:: - - jdk.tls.disabledAlgorithms=SSLv2Hello, SSLv3, TLSv1, TLSv1.1, DH keySize < 128, RSA keySize < 128, DES keySize < 128, SHA1 keySize < 128, MD5 keySize < 128, RC4 - -After configuring above settings, restart the management server to disable TLS -versions for CloudStack management server ports 8250 (agent server) and 8443 -(Jetty/HTTPS server). Database Replication (Optional) ---
[cloudstack-documentation] branch 4.11 updated: installdocs: docs for https/ssl configuration (#26)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git The following commit(s) were added to refs/heads/4.11 by this push: new 5b4f601 installdocs: docs for https/ssl configuration (#26) 5b4f601 is described below commit 5b4f601b474c85321dfae33b59f5fc2562200f4f Author: Rohit Yadav AuthorDate: Tue Feb 5 13:27:39 2019 +0530 installdocs: docs for https/ssl configuration (#26) Docs for https and TLS setup/configuration Signed-off-by: Rohit Yadav --- source/installguide/optional_installation.rst | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/source/installguide/optional_installation.rst b/source/installguide/optional_installation.rst index de2d328..8e1617f 100644 --- a/source/installguide/optional_installation.rst +++ b/source/installguide/optional_installation.rst @@ -92,14 +92,26 @@ SSL (Optional) -- CloudStack provides HTTP access in its default installation. There are a -number of technologies and sites which choose to implement SSL. As a +number of technologies and sites which choose to implement SSL/TLS. As a result, we have left CloudStack to expose HTTP under the assumption that a site will implement its typical practice. -CloudStack uses Tomcat as its servlet container. For sites that would -like CloudStack to terminate the SSL session, Tomcat’s SSL access may be -enabled. Tomcat SSL configuration is described at -http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html. +CloudStack 4.9 and above uses embedded Jetty as its servlet container. For sites +that would like CloudStack to terminate the SSL session, HTTPS can be enabled +by configuring the https-related settings in CloudStack management server's +server.properties file at /etc/cloudstack/management/ location: + + .. parsed-literal:: + + # For management server to pickup these configuration settings, the configured + # keystore file should exists and be readable by the management server. + https.enable=true + https.port=8443 + https.keystore=/etc/cloudstack/management/cloud.jks + https.keystore.password=vmops.com + +For storing certificates, admins can create and configure a java keystore file +and configure the same in the server.properties file as illustrated above. Database Replication (Optional)
[cloudstack-documentation] branch security-tls-config deleted (was bed67ed)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch security-tls-config in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git. was bed67ed the tls ciphers bug was fixed, remove unnecessary doc The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[cloudstack-documentation] branch master updated: Update kvm.rst (#27)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git The following commit(s) were added to refs/heads/master by this push: new 26ae28e Update kvm.rst (#27) 26ae28e is described below commit 26ae28eb1da6fec0c6f043522b4b45921308f591 Author: Bitworks LLC AuthorDate: Tue Feb 5 03:00:27 2019 -0500 Update kvm.rst (#27) --- source/installguide/hypervisor/kvm.rst | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/installguide/hypervisor/kvm.rst b/source/installguide/hypervisor/kvm.rst index c5cc5ff..1668c56 100644 --- a/source/installguide/hypervisor/kvm.rst +++ b/source/installguide/hypervisor/kvm.rst @@ -317,19 +317,19 @@ cloudstack-agent and should already be installed. env libvirtd_opts="-d -l" - On Ubuntu 16.04: just modify ``/etc/init/libvirt-bin.conf`` + On Ubuntu 16.04: just modify ``/etc/default/libvirt-bin`` - Add "-l" to the following line + Uncomment and change the following line .. parsed-literal:: - env libvirtd_opts="-d" + #env libvirtd_opts="" so it looks like: .. parsed-literal:: - env libvirtd_opts="-d -l" + env libvirtd_opts="-l"
[cloudstack-documentation] branch master updated: installdocs: docs for https/ssl configuration (#26)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git The following commit(s) were added to refs/heads/master by this push: new 5b4f601 installdocs: docs for https/ssl configuration (#26) new 7a00bb3 Merge remote-tracking branch 'origin/4.11' 5b4f601 is described below commit 5b4f601b474c85321dfae33b59f5fc2562200f4f Author: Rohit Yadav AuthorDate: Tue Feb 5 13:27:39 2019 +0530 installdocs: docs for https/ssl configuration (#26) Docs for https and TLS setup/configuration Signed-off-by: Rohit Yadav --- source/installguide/optional_installation.rst | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/source/installguide/optional_installation.rst b/source/installguide/optional_installation.rst index de2d328..8e1617f 100644 --- a/source/installguide/optional_installation.rst +++ b/source/installguide/optional_installation.rst @@ -92,14 +92,26 @@ SSL (Optional) -- CloudStack provides HTTP access in its default installation. There are a -number of technologies and sites which choose to implement SSL. As a +number of technologies and sites which choose to implement SSL/TLS. As a result, we have left CloudStack to expose HTTP under the assumption that a site will implement its typical practice. -CloudStack uses Tomcat as its servlet container. For sites that would -like CloudStack to terminate the SSL session, Tomcat’s SSL access may be -enabled. Tomcat SSL configuration is described at -http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html. +CloudStack 4.9 and above uses embedded Jetty as its servlet container. For sites +that would like CloudStack to terminate the SSL session, HTTPS can be enabled +by configuring the https-related settings in CloudStack management server's +server.properties file at /etc/cloudstack/management/ location: + + .. parsed-literal:: + + # For management server to pickup these configuration settings, the configured + # keystore file should exists and be readable by the management server. + https.enable=true + https.port=8443 + https.keystore=/etc/cloudstack/management/cloud.jks + https.keystore.password=vmops.com + +For storing certificates, admins can create and configure a java keystore file +and configure the same in the server.properties file as illustrated above. Database Replication (Optional)
[cloudstack-cloudmonkey] branch master updated: cli: implement auto-completion for apis
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new ff373cd cli: implement auto-completion for apis ff373cd is described below commit ff373cd11187234c77f2ff2bfc68de2d82828433 Author: Rohit Yadav AuthorDate: Fri Apr 13 04:43:09 2018 +0530 cli: implement auto-completion for apis Signed-off-by: Rohit Yadav --- .gitignore | 2 +- Makefile | 2 +- cli/completer.go | 218 +++ cli/selector.go | 47 cmd/api.go | 29 cmd/network.go | 4 +- config/cache.go | 69 ++ config/config.go | 43 +++ config/util.go | 67 - 9 files changed, 316 insertions(+), 165 deletions(-) diff --git a/.gitignore b/.gitignore index 0cbfde4..67cb950 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,5 @@ dist *.exe *.test *.out -.gopath~ +.gopath .idea diff --git a/Makefile b/Makefile index 41184d9..d32b6be 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ PACKAGE = cloudmonkey DATE?= $(shell date +%FT%T%z) VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || \ cat $(CURDIR)/.version 2> /dev/null || echo v0) -GOPATH = $(CURDIR)/.gopath~ +GOPATH = $(CURDIR)/.gopath BIN = $(GOPATH)/bin BASE = $(GOPATH)/src/$(PACKAGE) PKGS = $(or $(PKG),$(shell cd $(BASE) && env GOPATH=$(GOPATH) $(GO) list ./... | grep -v "^$(PACKAGE)/vendor/")) diff --git a/cli/completer.go b/cli/completer.go index ba45391..1a4c0a2 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -35,7 +35,29 @@ type CliCompleter struct { var completer *CliCompleter -func TrimSpaceLeft(in []rune) []rune { +func buildApiCacheMap(apiMap map[string][]*config.Api) map[string][]*config.Api { + for _, cmd := range cmd.AllCommands() { + verb := cmd.Name + if cmd.SubCommands != nil && len(cmd.SubCommands) > 0 { + for _, scmd := range cmd.SubCommands { + dummyApi := &config.Api{ + Name: scmd, + Verb: verb, + } + apiMap[verb] = append(apiMap[verb], dummyApi) + } + } else { + dummyApi := &config.Api{ + Name: "", + Verb: verb, + } + apiMap[verb] = append(apiMap[verb], dummyApi) + } + } + return apiMap +} + +func trimSpaceLeft(in []rune) []rune { firstIndex := len(in) for i, r := range in { if unicode.IsSpace(r) == false { @@ -65,36 +87,9 @@ func doInternal(line []rune, pos int, lineLen int, argName []rune) (newLine [][] return } -func (t *CliCompleter) Do(line []rune, pos int) (newLine [][]rune, offset int) { - - line = TrimSpaceLeft(line[:pos]) - lineLen := len(line) +func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { - apiCache := t.Config.GetCache() - apiMap := make(map[string][]*config.Api) - for api := range apiCache { - verb := apiCache[api].Verb - apiMap[verb] = append(apiMap[verb], apiCache[api]) - } - - for _, cmd := range cmd.AllCommands() { - verb := cmd.Name - if cmd.SubCommands != nil && len(cmd.SubCommands) > 0 { - for _, scmd := range cmd.SubCommands { - dummyApi := &config.Api{ - Name: scmd, - Verb: verb, - } - apiMap[verb] = append(apiMap[verb], dummyApi) - } - } else { - dummyApi := &config.Api{ - Name: "", - Verb: verb, - } - apiMap[verb] = append(apiMap[verb], dummyApi) - } - } + apiMap := buildApiCacheMap(t.Config.GetApiVerbMap()) var verbs []string for verb := range apiMap { @@ -105,56 +100,155 @@ func (t *CliCompleter) Do(line []rune, pos int) (newLine [][]rune, offset int) { } sort.Strings(verbs) - var verbsFound []string + line = trimSpaceLeft(line[:pos]) + + // Auto-complete verb + var verbFound string for _, verb := range verbs { search := verb + " " if !runes
[cloudstack] branch master updated: readme: Improve README (#2570)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new 68b2b17 readme: Improve README (#2570) 68b2b17 is described below commit 68b2b173225ef1462204759d8724de92273f0cdc Author: Jorge Maldonado Ventura AuthorDate: Fri Apr 13 13:04:00 2018 +0200 readme: Improve README (#2570) - Add space between stop and next sentence - Add missing full stops --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 17a7a8f..471672f 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Interested in helping out with Apache CloudStack? Great! We welcome participation from anybody willing to work [The Apache Way](http://theapacheway.com) and make a contribution. Note that you do not have to be a developer in order to contribute to Apache CloudStack. We need folks to help with documentation, translation, -promotion etc.See our contribution [page](http://cloudstack.apache.org/contribute.html). +promotion etc. See our contribution [page](http://cloudstack.apache.org/contribute.html). If you're interested in learning more or participating in the Apache CloudStack project, the mailing lists are the best way to do that. While the project has @@ -100,7 +100,7 @@ If you've found an issue that you believe is a security vulnerability in a released version of CloudStack, please report it to `secur...@cloudstack.apache.org` with details about the vulnerability, how it might be exploited, and any additional information that might be useful. -For more details, please visit our security [page](http://cloudstack.apache.org/security.html) +For more details, please visit our security [page](http://cloudstack.apache.org/security.html). ## License @@ -143,7 +143,7 @@ Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Sec The following provides more details on the included cryptographic software: -* CloudStack makes use of JaSypt cryptographic libraries +* CloudStack makes use of JaSypt cryptographic libraries. * CloudStack has a system requirement of MySQL, and uses native database encryption functionality. * CloudStack makes use of the Bouncy Castle general-purpose encryption library. * CloudStack can optionally interacts with and controls OpenSwan-based VPNs. -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 03/05: cmk: on error return non-zero exit code
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit c453cc9213c8f34c7a2c053630c559795039e564 Author: Rohit Yadav AuthorDate: Fri Apr 13 18:22:45 2018 +0530 cmk: on error return non-zero exit code Signed-off-by: Rohit Yadav --- cli/selector.go | 4 ++-- cli/shell.go| 2 +- cmk.go | 7 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cli/selector.go b/cli/selector.go index d0c3656..cfb8629 100644 --- a/cli/selector.go +++ b/cli/selector.go @@ -67,7 +67,7 @@ func ShowSelector(options []SelectOption) SelectOption { - Current Selection -- {{ "Id:" | faint }} {{ .Id }} {{ "Name:" | faint }} {{ .Name }} -{{ "Description:" | faint }} {{ .Detail }}`, +{{ "Info:" | faint }} {{ .Detail }}`, } searcher := func(input string, index int) bool { @@ -79,7 +79,7 @@ func ShowSelector(options []SelectOption) SelectOption { } prompt := promptui.Select{ - Label: "Use the arrow keys to navigate: ↓ ↑ → ←. Press / to toggle 🔍search", + Label: "Use the arrow keys to navigate: ↓ ↑ → ← press / to toggle 🔍search", Items: options, Templates: templates, Size: 5, diff --git a/cli/shell.go b/cli/shell.go index 593c13d..bf9f93e 100644 --- a/cli/shell.go +++ b/cli/shell.go @@ -81,7 +81,7 @@ func ExecShell(cfg *config.Config) { err = ExecCmd(cfg, args, shell) if err != nil { - fmt.Println("Error:", err) + fmt.Println("🙈 Error:", err) } } } diff --git a/cmk.go b/cmk.go index 68fcb3d..b557f48 100644 --- a/cmk.go +++ b/cmk.go @@ -18,6 +18,7 @@ package main import ( + "fmt" "os" "cloudmonkey/cli" @@ -28,7 +29,11 @@ func main() { args := os.Args[1:] cfg := config.NewConfig() if len(args) > 0 { - cli.ExecCmd(cfg, args, nil) + err := cli.ExecCmd(cfg, args, nil) + if err != nil { + fmt.Println("🙈 Error:", err) + os.Exit(1) + } } else { cli.ExecShell(cfg) } -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 01/05: cli: improve selector and autocompletion
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 06b38b73bdbb2431ed151d183ae1367de0c78803 Author: Rohit Yadav AuthorDate: Fri Apr 13 18:21:32 2018 +0530 cli: improve selector and autocompletion Signed-off-by: Rohit Yadav --- cli/completer.go | 6 +++--- cli/selector.go | 8 cmd/api.go | 2 +- config/cache.go | 2 +- config/config.go | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/completer.go b/cli/completer.go index 1a4c0a2..58dadcc 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -233,10 +233,10 @@ func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { }) fmt.Println() selectedOption := ShowSelector(autocompleteOptions) - if arg.Name == "account" { - selected = selectedOption.Name - } else { + if strings.HasSuffix(arg.Name, "id") || strings.HasSuffix(arg.Name, "ids") { selected = selectedOption.Id + } else { + selected = selectedOption.Name } } else { if len(autocompleteOptions) == 1 { diff --git a/cli/selector.go b/cli/selector.go index bb1696e..d0c3656 100644 --- a/cli/selector.go +++ b/cli/selector.go @@ -59,10 +59,10 @@ func ShowSelector(options []SelectOption) SelectOption { defer selector.unlock() templates := &promptui.SelectTemplates{ - Label:"{{ . }}?", - Active: "🐵 {{ .Name | cyan }} ({{ .Id | red }})", + Label:"{{ . }}", + Active: "▶ {{ .Name | cyan }} ({{ .Id | red }})", Inactive: " {{ .Name | cyan }} ({{ .Id | red }})", - Selected: "Selected: {{ .Name | cyan }} ({{ .Id | red }})", + Selected: "👊Selected: {{ .Name | cyan }} ({{ .Id | red }})", Details: ` - Current Selection -- {{ "Id:" | faint }} {{ .Id }} @@ -79,7 +79,7 @@ func ShowSelector(options []SelectOption) SelectOption { } prompt := promptui.Select{ - Label: "Use the arrow keys to navigate: ↓ ↑ → ← and / toggles search", + Label: "Use the arrow keys to navigate: ↓ ↑ → ←. Press / to toggle 🔍search", Items: options, Templates: templates, Size: 5, diff --git a/cmd/api.go b/cmd/api.go index ff9d0ce..9dc5c9a 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -76,7 +76,7 @@ func init() { } if len(missingArgs) > 0 { - fmt.Println("Missing required arguments: ", strings.Join(missingArgs, ", ")) + fmt.Println("💩 Missing required arguments: ", strings.Join(missingArgs, ", ")) return nil } diff --git a/config/cache.go b/config/cache.go index 27b431f..e908cea 100644 --- a/config/cache.go +++ b/config/cache.go @@ -96,7 +96,7 @@ func (c *Config) UpdateCache(response map[string]interface{}) interface{} { for _, node := range apiList { api, valid := node.(map[string]interface{}) if !valid { - //fmt.Println("Errro, moving on") + fmt.Println("Errro, moving on 🍌") continue } apiName := api["name"].(string) diff --git a/config/config.go b/config/config.go index 0f2d71e..1a445a6 100644 --- a/config/config.go +++ b/config/config.go @@ -135,7 +135,7 @@ func (c *Config) UpdateGlobalConfig(key string, value string) { } func (c *Config) UpdateConfig(namespace string, key string, value string) { - fmt.Println("Updating for key", key, ", value=", value, ", in ns=", namespace) + fmt.Println("👌 Updating for key", key, ", value=", value, ", in ns=", namespace) if key == "profile" { //FIXME c.ActiveProfile.Name = value -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 05/05: travis: enable travis for build checks
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 6027bf744ccae3c6218ad40a15ae7f99970ec172 Author: Rohit Yadav AuthorDate: Sat Apr 14 00:00:19 2018 +0530 travis: enable travis for build checks Signed-off-by: Rohit Yadav --- .travis.yml | 26 ++ 1 file changed, 26 insertions(+) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000..5acfcd3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +sudo: false +language: go +go: + - 1.8.x + - 1.9.x + - 1.10.x + +script: + - make all -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 04/05: config: use a cross-platform compatible monkey emoji
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 3f2ce7501565f937c596d74fed48cb8c08bbedca Author: Rohit Yadav AuthorDate: Fri Apr 13 23:59:59 2018 +0530 config: use a cross-platform compatible monkey emoji Signed-off-by: Rohit Yadav --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 1a445a6..9122ec8 100644 --- a/config/config.go +++ b/config/config.go @@ -127,7 +127,7 @@ func (c *Config) PrintHeader() { } func (c *Config) GetPrompt() string { - return fmt.Sprintf("(%s) \033[34m🐵\033[0m > ", c.ActiveProfile.Name) + return fmt.Sprintf("(%s) 🐒 > ", c.ActiveProfile.Name) } func (c *Config) UpdateGlobalConfig(key string, value string) { -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 02/05: cli: improve docs output
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 49d5d1ef40375ec4912e12e8af63fe7368b4f434 Author: Rohit Yadav AuthorDate: Fri Apr 13 18:22:03 2018 +0530 cli: improve docs output Signed-off-by: Rohit Yadav --- cmd/api.go | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/api.go b/cmd/api.go index 9dc5c9a..727c3d9 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -48,16 +48,20 @@ func init() { api := r.Config.GetCache()[apiName] if api == nil { - return errors.New("unknown or unauthorized API: " + apiName) + return errors.New("unknown command or API requested") } if strings.Contains(strings.Join(apiArgs, " "), "-h") { fmt.Println("=== Help docs ===") - fmt.Println(api.Name, ":", api.Description) - fmt.Println("Async:", api.Async) - fmt.Println("Required params:", strings.Join(api.RequiredArgs, ", ")) + fmt.Printf("\033[34m%s\033[0m [async=%v] %s\n", api.Name, api.Async, api.Description) + if len(api.RequiredArgs) > 0 { + fmt.Println("Required params:", strings.Join(api.RequiredArgs, ", ")) + } + if len(api.Args) > 0 { + fmt.Println("API params:") + } for _, arg := range api.Args { - fmt.Println(arg.Name, "(", arg.Type, ")", arg.Description) + fmt.Printf("\033[35m%-24s\033[0m \033[36m%-12s\033[0m %s\n", arg.Name, arg.Type, arg.Description) } return nil } -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] branch master updated (ff373cd -> 6027bf7)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git. from ff373cd cli: implement auto-completion for apis new 06b38b7 cli: improve selector and autocompletion new 49d5d1e cli: improve docs output new c453cc9 cmk: on error return non-zero exit code new 3f2ce75 config: use a cross-platform compatible monkey emoji new 6027bf7 travis: enable travis for build checks The 5 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .gitignore => .travis.yml | 17 + cli/completer.go | 6 +++--- cli/selector.go | 10 +- cli/shell.go | 2 +- cmd/api.go| 16 ++-- cmk.go| 7 ++- config/cache.go | 2 +- config/config.go | 4 ++-- 8 files changed, 37 insertions(+), 27 deletions(-) copy .gitignore => .travis.yml (90%) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] branch master updated: docs: display better formatted help with 80char width
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new fa6d97b docs: display better formatted help with 80char width fa6d97b is described below commit fa6d97b6c1316da84487cc185448050feacb30fd Author: Rohit Yadav AuthorDate: Sat Apr 14 00:07:39 2018 +0530 docs: display better formatted help with 80char width Signed-off-by: Rohit Yadav --- README.md | 2 +- cmd/api.go | 17 ++--- cmd/help.go | 9 +++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6a4d002..d1bfd54 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## CloudMonkey +## CloudMonkey [![Build Status](https://travis-ci.org/apache/cloudstack-cloudmonkey.svg?branch=master)](https://travis-ci.org/apache/cloudstack-cloudmonkey) `cloudmonkey` :cloud::monkey_face: is a command line interface (CLI) for [Apache CloudStack](http://cloudstack.apache.org). diff --git a/cmd/api.go b/cmd/api.go index 727c3d9..ad51753 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -52,16 +52,27 @@ func init() { } if strings.Contains(strings.Join(apiArgs, " "), "-h") { - fmt.Println("=== Help docs ===") fmt.Printf("\033[34m%s\033[0m [async=%v] %s\n", api.Name, api.Async, api.Description) if len(api.RequiredArgs) > 0 { fmt.Println("Required params:", strings.Join(api.RequiredArgs, ", ")) } if len(api.Args) > 0 { - fmt.Println("API params:") + fmt.Printf("%-24s %-8s %s\n", "API Params", "Type", "Description") + fmt.Printf("%-24s %-8s %s\n", "==", "", "===") } for _, arg := range api.Args { - fmt.Printf("\033[35m%-24s\033[0m \033[36m%-12s\033[0m %s\n", arg.Name, arg.Type, arg.Description) + fmt.Printf("\033[35m%-24s\033[0m \033[36m%-8s\033[0m ", arg.Name, arg.Type) + info := []rune(arg.Description) + for i, r := range info { + fmt.Printf("%s", string(r)) + if i > 0 && i%45 == 0 { + fmt.Println() + for i := 0; i < 34; i++ { + fmt.Printf(" ") + } + } + } + fmt.Println() } return nil } diff --git a/cmd/help.go b/cmd/help.go index e26dc79..d038522 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -17,10 +17,6 @@ package cmd -import ( - "fmt" -) - func init() { AddCommand(&Command{ Name: "help", @@ -30,8 +26,9 @@ func init() { PrintUsage() return nil } - fmt.Println("FIXME: add cmd help docs") - return nil + //TODO: check it's not other commands? + r.Args = append(r.Args, "-h") + return apiCommand.Handle(r) }, }) } -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 04/04: prompt: emoji-roulette on new shell
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 88fcf8fe17735eb8a29613f228960815c189550b Author: Rohit Yadav AuthorDate: Sat Apr 14 03:35:58 2018 +0530 prompt: emoji-roulette on new shell Signed-off-by: Rohit Yadav --- cli/shell.go | 1 + config/config.go | 2 -- config/prompt.go | 48 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/cli/shell.go b/cli/shell.go index 1dfc075..903a607 100644 --- a/cli/shell.go +++ b/cli/shell.go @@ -57,6 +57,7 @@ func ExecShell(cfg *config.Config) { cfg.PrintHeader() for { + shell.SetPrompt(cfg.GetPrompt()) line, err := shell.Readline() if err == readline.ErrInterrupt { continue diff --git a/config/config.go b/config/config.go index b89cc54..e5336e5 100644 --- a/config/config.go +++ b/config/config.go @@ -151,8 +151,6 @@ func reloadConfig(cfg *Config) *Config { } // Save conf.SaveTo(cfg.ConfigFile) - - fmt.Println("Updating config to:", cfg.Core, cfg.Core.ActiveProfile) return cfg } diff --git a/config/prompt.go b/config/prompt.go new file mode 100644 index 000..ea8dd82 --- /dev/null +++ b/config/prompt.go @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package config + +import ( + "fmt" + "math/rand" + "runtime" + "strings" + "time" +) + +var emojis []string + +func init() { + rand.Seed(time.Now().Unix()) + emojis = strings.Split("🐶 🐹 🐰 🐻 🐼 🐨 🐯 🦁 🐷 🐙 🙈 🙉 🙊 🐒 🐔 🐧 🐦 🐤 🐣 🐥 🐺 🐗 🐴 🦄 🐝 🐛 🐌 🐞 🐜 🕷 🦂 🦀 🐍 🐢 🐠 🐟 🐡 🐬 🐳 🐋 🐅 🐃 🐂 🐄 🐘 🐐 🐑 🐎 🐖 🐀 🐓 🦃 🕊 🐕 🐩 🐈 🐇 🐿 🐲 🌵 🦍 🦊 🦌 🦏 🦇 🦅 🦆 🦉 🦈 🦐 🦑 🦋 🌴 🍀 🍂 🍁 🍄 🌍 ⛅️", " ") +} + +func emoji() string { + return emojis[rand.Intn(len(emojis)-1)] +} + +func promptMoji() string { + if runtime.GOOS == "windows" { + return "cmk" + } + return emoji() // 🐒 +} + +func (c *Config) GetPrompt() string { + return fmt.Sprintf("(%s) %s > ", c.Core.ProfileName, promptMoji()) +} -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] branch master updated (fa6d97b -> 88fcf8f)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git. from fa6d97b docs: display better formatted help with 80char width new 351fb28 vendor: merge readline forks, add go-ini for config management new ed77ec0 config: implement ini based config same as legacy cloudmonkey new 86b9e4a about: add separate go file for cli name, version new 88fcf8f prompt: emoji-roulette on new shell The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: cli/completer.go | 4 +- cli/exec.go| 2 +- cli/selector.go| 2 +- cli/shell.go | 6 +- cmd/network.go | 6 +- cmd/request.go | 2 +- cmd/version.go | 2 +- cmd/version.go => config/about.go | 23 +- config/config.go | 211 +++--- cmd/set.go => config/prompt.go | 41 +- vendor/github.com/chzyer/readline/runes.go | 1 + vendor/github.com/rhtyd/readline/ansi_windows.go | 249 --- vendor/github.com/rhtyd/readline/complete.go | 285 .../github.com/rhtyd/readline/complete_helper.go | 165 - .../github.com/rhtyd/readline/complete_segment.go | 82 --- vendor/github.com/rhtyd/readline/history.go| 330 - vendor/github.com/rhtyd/readline/operation.go | 531 --- vendor/github.com/rhtyd/readline/password.go | 33 - .../github.com/rhtyd/readline/rawreader_windows.go | 125 vendor/github.com/rhtyd/readline/readline.go | 326 - vendor/github.com/rhtyd/readline/remote.go | 475 - vendor/github.com/rhtyd/readline/runebuf.go| 629 - vendor/github.com/rhtyd/readline/runes.go | 224 -- vendor/github.com/rhtyd/readline/runes/runes.go| 155 - vendor/github.com/rhtyd/readline/search.go | 164 - vendor/github.com/rhtyd/readline/std.go| 197 -- vendor/github.com/rhtyd/readline/std_windows.go| 9 - vendor/github.com/rhtyd/readline/term.go | 123 vendor/github.com/rhtyd/readline/term_bsd.go | 29 - vendor/github.com/rhtyd/readline/term_linux.go | 33 - vendor/github.com/rhtyd/readline/term_solaris.go | 32 - vendor/github.com/rhtyd/readline/term_unix.go | 24 - vendor/github.com/rhtyd/readline/term_windows.go | 171 - vendor/github.com/rhtyd/readline/terminal.go | 238 --- vendor/github.com/rhtyd/readline/utils.go | 277 vendor/github.com/rhtyd/readline/utils_unix.go | 83 --- vendor/github.com/rhtyd/readline/utils_windows.go | 41 -- vendor/github.com/rhtyd/readline/vim.go| 176 - vendor/github.com/rhtyd/readline/windows_api.go| 152 - vendor/gopkg.in/ini.v1/error.go| 32 + vendor/gopkg.in/ini.v1/file.go | 407 +++ vendor/gopkg.in/ini.v1/ini.go | 197 ++ vendor/gopkg.in/ini.v1/key.go | 751 + vendor/gopkg.in/ini.v1/parser.go | 401 +++ vendor/gopkg.in/ini.v1/section.go | 257 +++ vendor/gopkg.in/ini.v1/struct.go | 512 ++ 46 files changed, 2741 insertions(+), 5474 deletions(-) copy cmd/version.go => config/about.go (70%) copy cmd/set.go => config/prompt.go (51%) delete mode 100644 vendor/github.com/rhtyd/readline/ansi_windows.go delete mode 100644 vendor/github.com/rhtyd/readline/complete.go delete mode 100644 vendor/github.com/rhtyd/readline/complete_helper.go delete mode 100644 vendor/github.com/rhtyd/readline/complete_segment.go delete mode 100644 vendor/github.com/rhtyd/readline/history.go delete mode 100644 vendor/github.com/rhtyd/readline/operation.go delete mode 100644 vendor/github.com/rhtyd/readline/password.go delete mode 100644 vendor/github.com/rhtyd/readline/rawreader_windows.go delete mode 100644 vendor/github.com/rhtyd/readline/readline.go delete mode 100644 vendor/github.com/rhtyd/readline/remote.go delete mode 100644 vendor/github.com/rhtyd/readline/runebuf.go delete mode 100644 vendor/github.com/rhtyd/readline/runes.go delete mode 100644 vendor/github.com/rhtyd/readline/runes/runes.go delete mode 100644 vendor/github.com/rhtyd/readline/search.go delete mode 100644 vendor/github.com/rhtyd/readline/std.go delete mode 100644 vendor/github.com/rhtyd/readline/std_windo
[cloudstack-cloudmonkey] 03/04: about: add separate go file for cli name, version
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 86b9e4a347a6f56c62af6ec98765a0c900884f47 Author: Rohit Yadav AuthorDate: Sat Apr 14 03:25:06 2018 +0530 about: add separate go file for cli name, version Signed-off-by: Rohit Yadav --- cmd/version.go | 2 +- config/about.go | 33 + 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 72fde90..c07c1d7 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -24,7 +24,7 @@ func init() { Name: "version", Help: "Version info", Handle: func(r *Request) error { - fmt.Println("Apache CloudStack 🐵 cloudmonkey", r.Config.Version()) + fmt.Println(r.Config.Name(), r.Config.Version()) return nil }, }) diff --git a/config/about.go b/config/about.go index d912156..0d59518 100644 --- a/config/about.go +++ b/config/about.go @@ -1 +1,34 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package config + +import "fmt" + +func (c *Config) Name() string { + return "Apache CloudStack 🐵 cloudmonkey" +} + +func (c *Config) Version() string { + return "6.0.0-alpha1" +} + +func (c *Config) PrintHeader() { + fmt.Println(c.Name(), c.Version()) + fmt.Println("Type \"help\" for details, \"sync\" to update API cache or press tab to list commands") + fmt.Println() +} -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 02/04: config: implement ini based config same as legacy cloudmonkey
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit ed77ec07d952c49d987a26a3c3d355bcaf00233b Author: Rohit Yadav AuthorDate: Sat Apr 14 03:24:27 2018 +0530 config: implement ini based config same as legacy cloudmonkey Signed-off-by: Rohit Yadav --- cli/completer.go | 2 +- cli/selector.go | 2 +- cli/shell.go | 3 + cmd/network.go | 6 +- config/about.go | 1 + config/config.go | 211 +++ 6 files changed, 144 insertions(+), 81 deletions(-) diff --git a/cli/completer.go b/cli/completer.go index 9cd9a04..58ff60b 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -188,7 +188,7 @@ func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { return nil, 0 } - r := cmd.NewRequest(nil, config.NewConfig(), nil, nil) + r := cmd.NewRequest(nil, shellConfig, nil, nil) autocompleteApiArgs := []string{"listall=true"} if autocompleteApi.Noun == "templates" { autocompleteApiArgs = append(autocompleteApiArgs, "templatefilter=all") diff --git a/cli/selector.go b/cli/selector.go index 0f0b998..27e03b2 100644 --- a/cli/selector.go +++ b/cli/selector.go @@ -21,8 +21,8 @@ import ( "fmt" "strings" - "github.com/manifoldco/promptui" "github.com/chzyer/readline" + "github.com/manifoldco/promptui" ) type SelectOption struct { diff --git a/cli/shell.go b/cli/shell.go index f8fc031..1dfc075 100644 --- a/cli/shell.go +++ b/cli/shell.go @@ -28,7 +28,10 @@ import ( "github.com/chzyer/readline" ) +var shellConfig *config.Config + func ExecShell(cfg *config.Config) { + shellConfig = cfg shell, err := readline.NewEx(&readline.Config{ Prompt:cfg.GetPrompt(), HistoryFile: cfg.HistoryFile, diff --git a/cmd/network.go b/cmd/network.go index 6ff7d7c..94f67ad 100644 --- a/cmd/network.go +++ b/cmd/network.go @@ -66,8 +66,8 @@ func NewAPIRequest(r *Request, api string, args []string) (map[string]interface{ } } - apiKey := r.Config.ActiveProfile.ApiKey - secretKey := r.Config.ActiveProfile.SecretKey + apiKey := r.Config.Core.ActiveProfile.ApiKey + secretKey := r.Config.Core.ActiveProfile.SecretKey if len(apiKey) > 0 { params.Add("apiKey", apiKey) @@ -81,7 +81,7 @@ func NewAPIRequest(r *Request, api string, args []string) (map[string]interface{ signature := base64.StdEncoding.EncodeToString(mac.Sum(nil)) encodedParams = encodedParams + fmt.Sprintf("&signature=%s", url.QueryEscape(signature)) - apiUrl := fmt.Sprintf("%s?%s", r.Config.ActiveProfile.Url, encodedParams) + apiUrl := fmt.Sprintf("%s?%s", r.Config.Core.ActiveProfile.Url, encodedParams) //fmt.Println("[debug] Requesting: ", apiUrl) response, err := http.Get(apiUrl) diff --git a/config/about.go b/config/about.go new file mode 100644 index 000..d912156 --- /dev/null +++ b/config/about.go @@ -0,0 +1 @@ +package config diff --git a/config/config.go b/config/config.go index 9122ec8..b89cc54 100644 --- a/config/config.go +++ b/config/config.go @@ -19,56 +19,54 @@ package config import ( "fmt" - homedir "github.com/mitchellh/go-homedir" + "github.com/mitchellh/go-homedir" + "gopkg.in/ini.v1" "os" "path" + "strconv" ) -var name = "cloudmonkey" -var version = "6.0.0-alpha1" - -func getDefaultConfigDir() string { - home, err := homedir.Dir() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - return path.Join(home, ".cmk") -} - -type OutputFormat string - const ( - Json OutputFormat = "json" - Xml OutputFormat = "xml" - Table OutputFormat = "table" - Text OutputFormat = "text" + Json = "json" + Xml = "xml" + Table = "table" + Text = "text" ) -type Profile struct { - Name string - Urlstring - VerifyCert bool - Username string - Password string - Domain string - ApiKey string - SecretKey string +type ServerProfile struct { + Urlstring `ini:"url"` + Username string `ini:"username"` + Password string `ini:"p
[cloudstack-cloudmonkey] branch master updated: lint: introduce lint and fix lint issues
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new 0eb9c6b lint: introduce lint and fix lint issues 0eb9c6b is described below commit 0eb9c6b87a56bb16efdadf6aac8376c8f1a8b19e Author: Rohit Yadav AuthorDate: Sat Apr 14 04:13:20 2018 +0530 lint: introduce lint and fix lint issues Signed-off-by: Rohit Yadav --- .travis.yml | 1 + cli/completer.go | 55 +++ cli/exec.go | 1 + cli/selector.go | 34 +- cli/shell.go | 10 +++--- cmd/api.go | 1 + cmd/command.go | 5 + cmd/network.go | 9 + cmd/request.go | 2 ++ cmd/set.go | 2 +- config/about.go | 3 +++ config/cache.go | 33 - config/config.go | 34 ++ config/prompt.go | 1 + 14 files changed, 105 insertions(+), 86 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5acfcd3..412ca24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,4 @@ go: script: - make all + - make lint diff --git a/cli/completer.go b/cli/completer.go index 58ff60b..271faa1 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -29,29 +29,27 @@ import ( "github.com/chzyer/readline/runes" ) -type CliCompleter struct { +type autoCompleter struct { Config *config.Config } -var completer *CliCompleter - -func buildApiCacheMap(apiMap map[string][]*config.Api) map[string][]*config.Api { +func buildAPICacheMap(apiMap map[string][]*config.API) map[string][]*config.API { for _, cmd := range cmd.AllCommands() { verb := cmd.Name if cmd.SubCommands != nil && len(cmd.SubCommands) > 0 { for _, scmd := range cmd.SubCommands { - dummyApi := &config.Api{ + dummyAPI := &config.API{ Name: scmd, Verb: verb, } - apiMap[verb] = append(apiMap[verb], dummyApi) + apiMap[verb] = append(apiMap[verb], dummyAPI) } } else { - dummyApi := &config.Api{ + dummyAPI := &config.API{ Name: "", Verb: verb, } - apiMap[verb] = append(apiMap[verb], dummyApi) + apiMap[verb] = append(apiMap[verb], dummyAPI) } } return apiMap @@ -87,9 +85,9 @@ func doInternal(line []rune, pos int, lineLen int, argName []rune) (newLine [][] return } -func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { +func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { - apiMap := buildApiCacheMap(t.Config.GetApiVerbMap()) + apiMap := buildAPICacheMap(t.Config.GetAPIVerbMap()) var verbs []string for verb := range apiMap { @@ -138,7 +136,7 @@ func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { } // Find API - var apiFound *config.Api + var apiFound *config.API for _, api := range apiMap[verbFound] { if api.Noun == nounFound { apiFound = api @@ -165,7 +163,7 @@ func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { return } - var autocompleteApi *config.Api + var autocompleteAPI *config.API var relatedNoun string if arg.Name == "id" || arg.Name == "ids" { relatedNoun = apiFound.Noun @@ -179,23 +177,23 @@ func (t *CliCompleter) Do(line []rune, pos int) (options [][]rune, offset int) { } for _, related := range apiMap["list"] { if relatedNoun == related.Noun { - autocompleteApi = related + autocompleteAPI = related break } } - if autocompleteApi == nil { + if autocompleteAPI == nil { return nil, 0 } - r := cmd.NewRequest(nil, shellConfig, nil, nil) - autocompleteApiArg
[cloudstack-cloudmonkey] branch master updated: help: fix help to work with -h and help
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new 15697d8 help: fix help to work with -h and help 15697d8 is described below commit 15697d888550fb6439467c33196e4530c6299fa7 Author: Rohit Yadav AuthorDate: Sat Apr 14 05:32:58 2018 +0530 help: fix help to work with -h and help Signed-off-by: Rohit Yadav --- cli/selector.go | 10 +- cmd/api.go | 34 +++--- cmd/help.go | 50 -- cmd/network.go | 1 - cmd/shell.go| 44 config/cache.go | 2 +- 6 files changed, 57 insertions(+), 84 deletions(-) diff --git a/cli/selector.go b/cli/selector.go index 104e16e..19933f9 100644 --- a/cli/selector.go +++ b/cli/selector.go @@ -59,10 +59,10 @@ func showSelector(options []selectOption) selectOption { defer optionSelector.unlock() templates := &promptui.SelectTemplates{ - Label:"{{ . }}", - Active: "▶ {{ .Name | cyan }} ({{ .ID | red }})", - Inactive: " {{ .Name | cyan }} ({{ .ID | red }})", - Selected: "👊Selected: {{ .Name | cyan }} ({{ .ID | red }})", + Label:"{{ . | magenta }}", + Active: "▶ {{ .Name | cyan }} ({{ .ID | green }})", + Inactive: " {{ .Name }} ({{ .ID }})", + Selected: "Selected option: {{ .Name | cyan }} ({{ .ID | green }})", Details: ` - Current Selection -- {{ "ID:" | faint }} {{ .ID }} @@ -79,7 +79,7 @@ func showSelector(options []selectOption) selectOption { } prompt := promptui.Select{ - Label: "Use the arrow keys to navigate: ↓ ↑ → ← press / to toggle 🔍search", + Label: "Use the arrow keys to navigate: ↓ ↑ → ← press / to toggle 🔍 search", Items: options, Templates: templates, Size: 5, diff --git a/cmd/api.go b/cmd/api.go index e185a74..facb25a 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -47,37 +47,18 @@ func init() { apiArgs = r.Args[2:] } + for _, arg := range r.Args { + if arg == "-h" { + r.Args[0] = apiName + return helpCommand.Handle(r) + } + } + api := r.Config.GetCache()[apiName] if api == nil { return errors.New("unknown command or API requested") } - if strings.Contains(strings.Join(apiArgs, " "), "-h") { - fmt.Printf("\033[34m%s\033[0m [async=%v] %s\n", api.Name, api.Async, api.Description) - if len(api.RequiredArgs) > 0 { - fmt.Println("Required params:", strings.Join(api.RequiredArgs, ", ")) - } - if len(api.Args) > 0 { - fmt.Printf("%-24s %-8s %s\n", "API Params", "Type", "Description") - fmt.Printf("%-24s %-8s %s\n", "==", "", "===") - } - for _, arg := range api.Args { - fmt.Printf("\033[35m%-24s\033[0m \033[36m%-8s\033[0m ", arg.Name, arg.Type) - info := []rune(arg.Description) - for i, r := range info { - fmt.Printf("%s", string(r)) - if i > 0 && i%45 == 0 { - fmt.Println() - for i := 0; i < 34; i++ { - fmt.Printf(" ") - } - } - } - fmt.Println() - } - return nil - } -
[cloudstack-cloudmonkey] branch master updated: set: autocompletion for set parameters
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new 3584ac0 set: autocompletion for set parameters 3584ac0 is described below commit 3584ac03f6899c7debd218f54351f70429983f11 Author: Rohit Yadav AuthorDate: Sat Apr 14 06:44:25 2018 +0530 set: autocompletion for set parameters Signed-off-by: Rohit Yadav --- cli/completer.go | 31 +-- cli/shell.go | 1 + cmd/api.go | 2 +- cmd/command.go | 2 +- cmd/set.go | 20 config/cache.go | 2 +- config/config.go | 17 + 7 files changed, 58 insertions(+), 17 deletions(-) diff --git a/cli/completer.go b/cli/completer.go index 271faa1..8ade3f6 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -37,12 +37,23 @@ func buildAPICacheMap(apiMap map[string][]*config.API) map[string][]*config.API for _, cmd := range cmd.AllCommands() { verb := cmd.Name if cmd.SubCommands != nil && len(cmd.SubCommands) > 0 { - for _, scmd := range cmd.SubCommands { - dummyAPI := &config.API{ - Name: scmd, - Verb: verb, + for command, opts := range cmd.SubCommands { + var args []*config.APIArg + options := opts + if command == "profile" { + options = config.GetProfiles() + } + for _, opt := range options { + args = append(args, &config.APIArg{ + Name: opt, + }) } - apiMap[verb] = append(apiMap[verb], dummyAPI) + apiMap[verb] = append(apiMap[verb], &config.API{ + Name: command, + Verb: verb, + Noun: command, + Args: args, + }) } } else { dummyAPI := &config.API{ @@ -151,7 +162,7 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) splitLine := strings.Split(string(line), " ") line = trimSpaceLeft([]rune(splitLine[len(splitLine)-1])) for _, arg := range apiFound.Args { - search := arg.Name + "=" + search := arg.Name if !runes.HasPrefix(line, []rune(search)) { sLine, sOffset := doInternal(line, pos, len(line), []rune(search)) options = append(options, sLine...) @@ -165,15 +176,15 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) var autocompleteAPI *config.API var relatedNoun string - if arg.Name == "id" || arg.Name == "ids" { + if arg.Name == "id=" || arg.Name == "ids=" { relatedNoun = apiFound.Noun if apiFound.Verb != "list" { relatedNoun += "s" } - } else if arg.Name == "account" { + } else if arg.Name == "account=" { relatedNoun = "accounts" } else { - relatedNoun = strings.Replace(strings.Replace(arg.Name, "ids", "", -1), "id", "", -1) + "s" + relatedNoun = strings.Replace(strings.Replace(arg.Name, "ids=", "", -1), "id=", "", -1) + "s" } for _, related := range apiMap["list"] { if relatedNoun == related.Noun { @@ -231,7 +242,7 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) }) fmt.Println() selectedOption := showSelector(autocompleteOptions) - if strings.HasSuffix(arg.Name, "id") || strings.HasSuffix(arg.Name, "ids") { + if strings.HasSuffix(arg
[cloudstack-cloudmonkey] branch master updated: client: implement login based API calls, simplify config
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new d0b58be client: implement login based API calls, simplify config d0b58be is described below commit d0b58bee3a7d223c2b521c870c741c0183c65022 Author: Rohit Yadav AuthorDate: Mon Apr 16 07:37:41 2018 +0530 client: implement login based API calls, simplify config Signed-off-by: Rohit Yadav --- cmd/api.go | 6 +++- cmd/login.go | 27 +++--- cmd/network.go | 87 +++- config/config.go | 67 ++- 4 files changed, 136 insertions(+), 51 deletions(-) diff --git a/cmd/api.go b/cmd/api.go index dd4400a..47a0f0f 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -77,7 +77,11 @@ func init() { return nil } - b, _ := NewAPIRequest(r, api.Name, apiArgs) + b, err := NewAPIRequest(r, api.Name, apiArgs) + if err != nil { + return err + } + response, _ := json.MarshalIndent(b, "", " ") // Implement various output formats diff --git a/cmd/login.go b/cmd/login.go index a2ace48..36b54e8 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -40,33 +40,52 @@ func init() { return nil } + // username prompt := promptui.Prompt{ Label:"Username", Validate: validate, Default: "", } - username, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return nil } + //password prompt = promptui.Prompt{ Label:"Password", Validate: validate, Mask: '*', } - password, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + return nil + } + // domain + prompt = promptui.Prompt{ + Label:"Domain", + Validate: validate, + Default: "/", + } + domain, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return nil } - // TODO: implement login based key setup workflow - fmt.Println("Trying to log in using", username, password) + r.Config.ActiveProfile.Username = username + r.Config.ActiveProfile.Password = password + r.Config.ActiveProfile.Domain = domain + + client, _, err := Login(r) + if client == nil || err != nil { + fmt.Println("Failed to login, check credentials") + } else { + fmt.Println("Success!") + } return nil }, diff --git a/cmd/network.go b/cmd/network.go index d40b7bd..1a57494 100644 --- a/cmd/network.go +++ b/cmd/network.go @@ -21,15 +21,18 @@ import ( "bytes" "crypto/hmac" "crypto/sha1" + "crypto/tls" "encoding/base64" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" + "net/http/cookiejar" "net/url" "sort" "strings" + "time" ) func encodeRequestParams(params url.Values) string { @@ -56,6 +59,42 @@ func encodeRequestParams(params url.Values) string { return buf.String() } +// Login logs in a user based on provided request and returns http client and session key +func Login(r *Request) (*http.Client, string, error) { + params := make(url.Values) + params.Add("command", "
[cloudstack] branch 4.11 updated: consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 392f62d consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562) 392f62d is described below commit 392f62dae0f59b3b00437d61ab8cee0ebfb9e60a Author: Rohit Yadav AuthorDate: Mon Apr 16 18:12:41 2018 +0530 consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562) This allows CloudStack to use a console proxy domain instead of public IP address even when ssl is not enabled but console proxy url/domain is defined in global settings. Signed-off-by: Rohit Yadav --- core/src/com/cloud/info/ConsoleProxyInfo.java | 5 + server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/com/cloud/info/ConsoleProxyInfo.java b/core/src/com/cloud/info/ConsoleProxyInfo.java index b15abcb..16993d7 100644 --- a/core/src/com/cloud/info/ConsoleProxyInfo.java +++ b/core/src/com/cloud/info/ConsoleProxyInfo.java @@ -19,6 +19,8 @@ package com.cloud.info; +import org.apache.commons.lang3.StringUtils; + public class ConsoleProxyInfo { private boolean sslEnabled; @@ -55,6 +57,9 @@ public class ConsoleProxyInfo { proxyImageUrl += ":" + this.proxyUrlPort; } else { proxyAddress = proxyIpAddress; +if (StringUtils.isNotBlank(consoleProxyUrlDomain)) { +proxyAddress = consoleProxyUrlDomain; +} proxyPort = port; this.proxyUrlPort = proxyUrlPort; diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index f131714..e6c0a8d 100644 --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -231,7 +231,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy private String _instance; private int _proxySessionTimeoutValue = DEFAULT_PROXY_SESSION_TIMEOUT; -private boolean _sslEnabled = true; +private boolean _sslEnabled = false; private String _consoleProxyUrlDomain; // global load picture at zone basis @@ -1246,8 +1246,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy Map configs = _configDao.getConfiguration("management-server", params); -String value = configs.get(Config.ConsoleProxyCmdPort.key()); -value = configs.get("consoleproxy.sslEnabled"); +String value = configs.get("consoleproxy.sslEnabled"); if (value != null && value.equalsIgnoreCase("true")) { _sslEnabled = true; } -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] branch master updated: cmk: fix presentational issues
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new e83ce7f cmk: fix presentational issues e83ce7f is described below commit e83ce7f96896b48ca13eb0c691caecd1fc8660d4 Author: Rohit Yadav AuthorDate: Mon Apr 16 21:20:16 2018 +0530 cmk: fix presentational issues Signed-off-by: Rohit Yadav --- cli/completer.go | 10 + cmd/api.go | 2 +- cmd/help.go | 8 +-- cmd/network.go | 5 ++--- config/config.go | 65 ++-- 5 files changed, 55 insertions(+), 35 deletions(-) diff --git a/cli/completer.go b/cli/completer.go index 8ade3f6..2444fd2 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -174,17 +174,18 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) return } + argName := strings.Replace(arg.Name, "=", "", -1) var autocompleteAPI *config.API var relatedNoun string - if arg.Name == "id=" || arg.Name == "ids=" { + if argName == "id" || argName == "ids" { relatedNoun = apiFound.Noun if apiFound.Verb != "list" { relatedNoun += "s" } - } else if arg.Name == "account=" { + } else if argName == "account" { relatedNoun = "accounts" } else { - relatedNoun = strings.Replace(strings.Replace(arg.Name, "ids=", "", -1), "id=", "", -1) + "s" + relatedNoun = strings.Replace(strings.Replace(argName, "ids", "", -1), "id", "", -1) + "s" } for _, related := range apiMap["list"] { if relatedNoun == related.Noun { @@ -202,7 +203,9 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) if autocompleteAPI.Noun == "templates" { autocompleteAPIArgs = append(autocompleteAPIArgs, "templatefilter=all") } + fmt.Printf("\nFetching options, please wait...") response, _ := cmd.NewAPIRequest(r, autocompleteAPI.Name, autocompleteAPIArgs) + fmt.Printf("\r") var autocompleteOptions []selectOption for _, v := range response { @@ -240,7 +243,6 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) sort.Slice(autocompleteOptions, func(i, j int) bool { return autocompleteOptions[i].Name < autocompleteOptions[j].Name }) - fmt.Println() selectedOption := showSelector(autocompleteOptions) if strings.HasSuffix(arg.Name, "id=") || strings.HasSuffix(arg.Name, "ids=") { selected = selectedOption.ID diff --git a/cmd/api.go b/cmd/api.go index 47a0f0f..215e58c 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -68,7 +68,7 @@ func init() { } } if !provided { - missingArgs = append(missingArgs, required) + missingArgs = append(missingArgs, strings.Replace(required, "=", "", -1)) } } diff --git a/cmd/help.go b/cmd/help.go index dc31e51..d027510 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -45,14 +45,18 @@ func init() { fmt.Println("This API is \033[35masynchronous\033[0m.") } if len(api.RequiredArgs) > 0 { - fmt.Println("Required params:", strings.Join(api.RequiredArgs, ", ")) + fmt.Printf("Required params: ") + for _, requiredArg := range api.RequiredArgs { + fmt.Printf("%s, ",
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit b940a892f76c32b761dc7a8eec0f9a3197c5ba30 Merge: c43c69a 392f62d Author: Rohit Yadav AuthorDate: Tue Apr 17 12:58:39 2018 +0530 Merge branch '4.11' core/src/main/java/com/cloud/info/ConsoleProxyInfo.java | 5 + .../main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java| 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated (c43c69a -> b940a89)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from c43c69a Merge release branch 4.11 to master add 392f62d consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562) new b940a89 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: core/src/main/java/com/cloud/info/ConsoleProxyInfo.java | 5 + .../main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java| 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-admin] branch 4.11 updated: CLOUDSTACK-10333: Update docs per secure live VM migration (#50)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-admin.git The following commit(s) were added to refs/heads/4.11 by this push: new 2e1350b CLOUDSTACK-10333: Update docs per secure live VM migration (#50) 2e1350b is described below commit 2e1350bb97e648ac5e39be6ce54f0336c30e990f Author: Rohit Yadav AuthorDate: Fri Apr 20 00:10:20 2018 +0530 CLOUDSTACK-10333: Update docs per secure live VM migration (#50) Signed-off-by: Rohit Yadav --- source/hosts.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/source/hosts.rst b/source/hosts.rst index 4ea93ee..70d8da5 100644 --- a/source/hosts.rst +++ b/source/hosts.rst @@ -740,3 +740,10 @@ and space are replaced with `~`: keystore-setup keystore-cert-import + +Starting 4.11.1, a KVM host is considered secured when it has its keystore and +certificates setup for both the agent and libvirtd process. A secured host will +only allow and initiate TLS enabled live VM migration. This requires libvirtd +to listen on default port 16514, and the port to be allowed in the firewall +rules. Certificate renewal (using the `provisionCertificate` API) will restart +both the libvirtd process and agent after deploying new certificates. -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-install] branch 4.11 updated: CLOUDSTACK-10333: update docs to enable libvirtd tls port (#36)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-install.git The following commit(s) were added to refs/heads/4.11 by this push: new fa75631 CLOUDSTACK-10333: update docs to enable libvirtd tls port (#36) fa75631 is described below commit fa756312358af17b65e811d9a95ea5274a78bf94 Author: Rohit Yadav AuthorDate: Fri Apr 20 00:11:48 2018 +0530 CLOUDSTACK-10333: update docs to enable libvirtd tls port (#36) Signed-off-by: Rohit Yadav --- source/hypervisor/kvm.rst | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/hypervisor/kvm.rst b/source/hypervisor/kvm.rst index 91c0ddf..e713ee7 100644 --- a/source/hypervisor/kvm.rst +++ b/source/hypervisor/kvm.rst @@ -991,7 +991,7 @@ using a firewall): #. 1798 -#. 16509 (libvirt) +#. 16509, 16514 (libvirt) #. 5900 - 6100 (VNC consoles) @@ -1020,6 +1020,9 @@ extra ports by executing the following iptable commands: $ iptables -I INPUT -p tcp -m tcp --dport 16509 -j ACCEPT .. sourcecode:: bash + $ iptables -I INPUT -p tcp -m tcp --dport 16514 -j ACCEPT + +.. sourcecode:: bash $ iptables -I INPUT -p tcp -m tcp --dport 5900:6100 -j ACCEPT @@ -1057,6 +1060,10 @@ To open the required ports, execute the following commands: .. sourcecode:: bash + $ ufw allow proto tcp from any to any port 16514 + +.. sourcecode:: bash + $ ufw allow proto tcp from any to any port 5900:6100 .. sourcecode:: bash -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-install] branch master updated: make sure we use the same nfs paths. /primary vs /mnt/primary (#27)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-install.git The following commit(s) were added to refs/heads/master by this push: new 92b75fa make sure we use the same nfs paths. /primary vs /mnt/primary (#27) 92b75fa is described below commit 92b75fa5e5c6b0ba1cc80598e8ae689f5d682e4d Author: Bram AuthorDate: Thu Apr 19 20:44:11 2018 +0200 make sure we use the same nfs paths. /primary vs /mnt/primary (#27) * make sure we use the same nfs paths. /primary vs /mnt/primary on the next page * provide mountpath when mounting nfs, install nfs-kernel-server when using ubuntu --- source/management-server/_nfs.rst | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/management-server/_nfs.rst b/source/management-server/_nfs.rst index 6a42925..afc491e 100644 --- a/source/management-server/_nfs.rst +++ b/source/management-server/_nfs.rst @@ -124,6 +124,12 @@ operating system version. yum install nfs-utils + On Debian/Ubuntu systems, use: + + .. sourcecode:: bash + + # apt-get install nfs-kernel-server + #. On the Management Server host, create two directories that you will use for primary and secondary storage. For example: @@ -242,9 +248,9 @@ operating system version. .. sourcecode:: bash - mkdir /primary - mount -t nfs :/export/primary + mkdir /mnt/primary + mount -t nfs :/export/primary /mnt/primary umount /primary mkdir /secondary - mount -t nfs :/export/secondary - umount /secondary + mount -t nfs :/export/secondary /mnt/secondary + umount /mnt/secondary -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: systemvm: Use double quotes with 'RROUTER' variable in "common.sh" script (#2586)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 9288c64 systemvm: Use double quotes with 'RROUTER' variable in "common.sh" script (#2586) 9288c64 is described below commit 9288c64e5f618e45844f19a902f022c9c9dec8b9 Author: Rafael Weingärtner AuthorDate: Thu Apr 19 15:57:45 2018 -0300 systemvm: Use double quotes with 'RROUTER' variable in "common.sh" script (#2586) While debugging the VR for #2579, I noticed that one of the scripts were breaking. The variable RROUTER was not set and this broke a conditional. Signed-off-by: Rohit Yadav --- systemvm/debian/opt/cloud/bin/setup/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index e24a277..d2a26c9 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -585,7 +585,7 @@ routing_svcs() { systemctl enable haproxy echo "haproxy apache2" > /var/cache/cloud/enabled_svcs echo "cloud nfs-common portmap" > /var/cache/cloud/disabled_svcs - if [ $RROUTER -eq 1 ] + if [ "$RROUTER" -eq "1" ] then systemctl disable --now dnsmasq systemctl enable conntrackd -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated: server: Remote empty VPN test class (#2587)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new fbf07fa server: Remote empty VPN test class (#2587) fbf07fa is described below commit fbf07fa56599380294f9dce0c49875c5ff7578f5 Author: Rafael Weingärtner AuthorDate: Thu Apr 19 15:58:38 2018 -0300 server: Remote empty VPN test class (#2587) I found this empty test while working on other PRs. Empty/ignored tests do not help us. I am removing it. In the future, if we manage to improve these classes, we can work on unit test cases for them. --- server/pom.xml | 1 - .../vpn/MockRemoteAccessVPNServiceProvider.java| 71 .../com/cloud/network/vpn/RemoteAccessVpnTest.java | 76 -- 3 files changed, 148 deletions(-) diff --git a/server/pom.xml b/server/pom.xml index 41668ec..cd99780 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -183,7 +183,6 @@ com/cloud/storage/dao/* com/cloud/vm/dao/* com/cloud/api/ListPerfTest.java -com/cloud/network/vpn/RemoteAccessVpnTest.java com/cloud/network/security/SecurityGroupManagerImpl2Test.java com/cloud/network/security/SecurityGroupManagerImpl2Test.java com/cloud/vpc/VpcTestConfiguration.java diff --git a/server/src/test/java/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java b/server/src/test/java/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java deleted file mode 100644 index 0156afb..000 --- a/server/src/test/java/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.network.vpn; - -import java.util.List; -import java.util.Map; - -import javax.naming.ConfigurationException; - -import com.cloud.exception.ResourceUnavailableException; -import com.cloud.network.RemoteAccessVpn; -import com.cloud.network.VpnUser; -import com.cloud.network.element.RemoteAccessVPNServiceProvider; -import com.cloud.utils.component.ManagerBase; - -public class MockRemoteAccessVPNServiceProvider extends ManagerBase implements RemoteAccessVPNServiceProvider { - -@Override -public boolean configure(String name, Map params) throws ConfigurationException { -return true; -} - -@Override -public String getName() { -return "MockRemoteAccessVPNServiceProvider"; -} - -@Override -public boolean start() { -return true; -} - -@Override -public boolean stop() { -// TODO Auto-generated method stub -return false; -} - -@Override -public String[] applyVpnUsers(RemoteAccessVpn vpn, List users) throws ResourceUnavailableException { -// TODO Auto-generated method stub -return null; -} - -@Override -public boolean startVpn(RemoteAccessVpn vpn) throws ResourceUnavailableException { -// TODO Auto-generated method stub -return false; -} - -@Override -public boolean stopVpn(RemoteAccessVpn vpn) throws ResourceUnavailableException { -// TODO Auto-generated method stub -return false; -} - -} diff --git a/server/src/test/java/com/cloud/network/vpn/RemoteAccessVpnTest.java b/server/src/test/java/com/cloud/network/vpn/RemoteAccessVpnTest.java deleted file mode 100644 index 58315e6..000 --- a/server/src/test/java/com/cloud/network/vpn/RemoteAccessVpnTest.java +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless re
[cloudstack] branch master updated: CLOUDSTACK-10357: Improve log messages in methods (#2580)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new fed3492 CLOUDSTACK-10357: Improve log messages in methods (#2580) fed3492 is described below commit fed3492b57625f415df556b5e2e44efee2257f50 Author: lzh3636 AuthorDate: Thu Apr 19 15:03:27 2018 -0400 CLOUDSTACK-10357: Improve log messages in methods (#2580) Fix several logs that mismatch method. Add stacktraces for throw new statements. --- .../com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java | 2 +- engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java | 2 +- .../apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java | 6 +++--- .../main/java/org/apache/cloudstack/api/DeleteBaremetalRctCmd.java | 4 ++-- .../java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | 4 ++-- .../java/org/apache/cloudstack/cloudian/client/CloudianClient.java | 2 +- .../com/cloud/network/resource/NetScalerControlCenterResource.java | 2 +- .../src/main/java/com/cloud/network/resource/NuageVspResource.java | 2 +- server/src/main/java/com/cloud/network/NetworkModelImpl.java| 2 +- server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java | 2 +- .../java/com/cloud/hypervisor/vmware/mo/HostDatastoreBrowserMO.java | 2 +- .../main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java index b3b17e7..fb5e327 100644 --- a/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java +++ b/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java @@ -246,7 +246,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe } String internalDns1 = (String) params.get("internaldns1"); if (internalDns1 == null) { -s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage"); +s_logger.warn("No DNS entry found during configuration of ConsoleProxy"); } else { addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1); } diff --git a/engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java index d13234d..10a133c 100644 --- a/engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java @@ -410,7 +410,7 @@ public class UserVmDaoImpl extends GenericDaoBase implements Use } catch (Exception e) { -s_logger.error("listVmDetails:Exception:" + e.getMessage()); +s_logger.error("listPodIdsHavingVmsforAccount:Exception:" + e.getMessage()); } } diff --git a/plugins/dedicated-resources/src/main/java/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java b/plugins/dedicated-resources/src/main/java/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java index 7cf193d..cd6d8cf 100644 --- a/plugins/dedicated-resources/src/main/java/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java +++ b/plugins/dedicated-resources/src/main/java/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java @@ -497,8 +497,8 @@ public class DedicatedResourceManagerImpl implements DedicatedService { } dedicatedResource = _dedicatedDao.persist(dedicatedResource); } catch (Exception e) { -s_logger.error("Unable to dedicate host due to " + e.getMessage(), e); -throw new CloudRuntimeException("Failed to dedicate cluster. Please contact Cloud Support."); +s_logger.error("Unable to dedicate cluster due to " + e.getMessage(), e); +throw new CloudRuntimeException("Failed to dedicate cluster. Please contact Cloud Support.", e); } List result = new ArrayList(); @@ -595,7 +595,7 @@ public class DedicatedResourceManagerImpl implements DedicatedService { dedicatedResource = _dedicatedDao.persist(dedicatedResource); } catch (Exception e) { s_logger.error("Unable to dedicate host due to " + e.getMessage(), e); -throw new CloudRuntimeException("Failed to dedicate host. Please contact Cloud Support.")
[cloudstack] branch 4.11 updated: CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 8da2462 CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505) 8da2462 is described below commit 8da2462469db9656e9749ed5607635ce53e8581e Author: Rohit Yadav AuthorDate: Fri Apr 20 00:36:18 2018 +0530 CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505) This extends securing of KVM hosts to securing of libvirt on KVM host as well for TLS enabled live VM migration. To simplify implementation securing of host implies that both host and libvirtd processes are secured with management server's CA plugin issued certificates. Based on whether keystore and certificates files are available at /etc/cloudstack/agent, the KVM agent determines whether to use TLS or TCP based uris for live VM migration. It is also enforced that a secured host will allow live VM migration to/from other secured host, and an unsecured hosts will allow live VM migration to/from other unsecured host only. Post upgrade the KVM agent on startup will expose its security state (secured detail is sent as true or false) to the managements server that gets saved in host_details for the host. This host detail can be accesed via the listHosts response, and in the UI unsecured KVM hosts will show up with the host state of ‘unsecured’. Further, a button has been added that allows admins to provision/renew certificates to KVM hosts and can be used to secure any unsecured KVM host. The `cloudstack-setup-agent` was modified to accept a new flag `-s` which will reconfigure libvirtd with following settings: listen_tcp=0 listen_tls=1 tcp_port="16509" tls_port="16514" auth_tcp="none" auth_tls="none" key_file = "/etc/pki/libvirt/private/serverkey.pem" cert_file = "/etc/pki/libvirt/servercert.pem" ca_file = "/etc/pki/CA/cacert.pem" For a connected KVM host agent, when the certificate are renewed/provisioned a background task is scheduled that waits until all of the agent tasks finish after which libvirt process is restarted and finally the agent is restarted via AgentShell. There are no API or DB changes. Signed-off-by: Rohit Yadav --- agent/bindir/cloud-setup-agent.in | 12 +- agent/src/com/cloud/agent/Agent.java | 155 +-- agent/src/com/cloud/agent/AgentShell.java | 7 +- agent/src/com/cloud/agent/IAgentShell.java | 5 + .../virtualnetwork/VirtualRoutingResource.java | 18 +- .../ca/PostCertificateRenewalCommand.java | 34 +++ .../cloudstack/ca/SetupCertificateCommand.java | 6 +- debian/cloudstack-agent.postinst | 1 + .../cloudstack/ca/provider/RootCAProvider.java | 2 +- .../kvm/resource/LibvirtComputingResource.java | 43 ++- .../wrapper/LibvirtMigrateCommandWrapper.java | 20 +- .../LibvirtModifyTargetsCommandWrapper.java| 2 +- ...ibvirtPostCertificateRenewalCommandWrapper.java | 52 .../wrapper/LibvirtMigrateCommandWrapperTest.java | 22 ++ python/lib/cloud_utils.py | 4 +- python/lib/cloudutils/serviceConfig.py | 35 ++- scripts/util/keystore-cert-import | 13 + .../kvm/discoverer/LibvirtServerDiscoverer.java| 32 +-- .../org/apache/cloudstack/ca/CAManagerImpl.java| 3 +- test/integration/smoke/test_vm_life_cycle.py | 310 - ui/css/cloudstack3.css | 2 + ui/l10n/en.js | 2 + ui/scripts/system.js | 51 +++- utils/src/main/java/com/cloud/utils/nio/Link.java | 8 +- .../main/java/com/cloud/utils/script/Script.java | 2 +- .../java/com/cloud/utils/ssh/SSHCmdHelper.java | 4 +- .../cloudstack/utils/security/KeyStoreUtils.java | 39 ++- 27 files changed, 775 insertions(+), 109 deletions(-) diff --git a/agent/bindir/cloud-setup-agent.in b/agent/bindir/cloud-setup-agent.in index 8d2b919..3c6203c 100755 --- a/agent/bindir/cloud-setup-agent.in +++ b/agent/bindir/cloud-setup-agent.in @@ -26,6 +26,7 @@ from cloudutils.configFileOps import configFileOps from cloudutils.globalEnv import globalEnv from cloudutils.networkConfig import networkConfig from cloudutils.syscfg import sysConfigFactory +from cloudutils.serviceConfig import configureLibvirtConfig from optparse import OptionParser @@ -100,6 +101,7 @@ if __name__ == '__main__': parser.add_option("-c", "--cluster", dest="cluster", help="cluster id")
[cloudstack] branch 4.11 updated: capacity: remove unused threadpool (#2588)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new f46518a9 capacity: remove unused threadpool (#2588) f46518a9 is described below commit f46518a9be4f7e033652d1199d4660abc85a14ca Author: Rohit Yadav AuthorDate: Fri Apr 20 00:53:57 2018 +0530 capacity: remove unused threadpool (#2588) This removes unused injectables and threadpool. Signed-off-by: Rohit Yadav --- .../src/com/cloud/capacity/CapacityManagerImpl.java | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java index 9cc5e42..a94a864 100644 --- a/server/src/com/cloud/capacity/CapacityManagerImpl.java +++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java @@ -20,27 +20,21 @@ import java.net.URI; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.resource.ResourceState; -import com.cloud.utils.fsm.StateMachine2; -import org.apache.log4j.Logger; - import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; -import org.apache.cloudstack.framework.config.ConfigDepot; import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.PublishScope; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; +import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.Listener; @@ -52,7 +46,6 @@ import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupRoutingCommand; import com.cloud.capacity.dao.CapacityDao; import com.cloud.configuration.Config; -import com.cloud.configuration.ConfigurationManager; import com.cloud.dc.ClusterDetailsDao; import com.cloud.dc.ClusterDetailsVO; import com.cloud.dc.ClusterVO; @@ -69,6 +62,7 @@ import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao; import com.cloud.offering.ServiceOffering; import com.cloud.resource.ResourceListener; import com.cloud.resource.ResourceManager; +import com.cloud.resource.ResourceState; import com.cloud.resource.ServerResource; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; @@ -81,7 +75,6 @@ import com.cloud.utils.DateUtil; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; import com.cloud.utils.component.ManagerBase; -import com.cloud.utils.concurrency.NamedThreadFactory; import com.cloud.utils.db.DB; import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.Transaction; @@ -89,6 +82,7 @@ import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionStatus; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.fsm.StateListener; +import com.cloud.utils.fsm.StateMachine2; import com.cloud.vm.UserVmDetailVO; import com.cloud.vm.UserVmVO; import com.cloud.vm.VMInstanceVO; @@ -124,8 +118,6 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, @Inject StorageManager _storageMgr; @Inject -ConfigurationManager _configMgr; -@Inject HypervisorCapabilitiesDao _hypervisorCapabilitiesDao; @Inject protected VMSnapshotDao _vmSnapshotDao; @@ -136,14 +128,11 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, @Inject ClusterDao _clusterDao; @Inject -ConfigDepot _configDepot; -@Inject DataStoreProviderManager _dataStoreProviderMgr; @Inject ClusterDetailsDao _clusterDetailsDao; private int _vmCapacityReleaseInterval; -private ScheduledExecutorService _executor; long _extraBytesPerVolume = 0; @Inject @@ -155,7 +144,6 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, public boolean configure(String name, Map params) throws ConfigurationException { _vmCapacityReleaseInterval = NumbersUtil.parseInt(_configDao.getValue(Config.CapacitySkipcountingHours.key()), 3600); -_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("HostCapacity-Checker")); VirtualMachine.State.getSt
[cloudstack] branch master updated (fed3492 -> 644b091)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from fed3492 CLOUDSTACK-10357: Improve log messages in methods (#2580) add 9288c64 systemvm: Use double quotes with 'RROUTER' variable in "common.sh" script (#2586) add 8da2462 CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505) new 644b091 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: agent/bindir/cloud-setup-agent.in | 12 +- agent/src/main/java/com/cloud/agent/Agent.java | 155 +-- .../src/main/java/com/cloud/agent/AgentShell.java | 7 +- .../src/main/java/com/cloud/agent/IAgentShell.java | 5 + .../virtualnetwork/VirtualRoutingResource.java | 18 +- .../ca/PostCertificateRenewalCommand.java | 18 +- .../cloudstack/ca/SetupCertificateCommand.java | 6 +- debian/cloudstack-agent.postinst | 1 + .../cloudstack/ca/provider/RootCAProvider.java | 2 +- ...ibvirtPostCertificateRenewalCommandWrapper.java | 52 .../kvm/resource/LibvirtComputingResource.java | 43 ++- .../wrapper/LibvirtMigrateCommandWrapper.java | 20 +- .../LibvirtModifyTargetsCommandWrapper.java| 2 +- .../wrapper/LibvirtMigrateCommandWrapperTest.java | 22 ++ python/lib/cloud_utils.py | 4 +- python/lib/cloudutils/serviceConfig.py | 35 ++- scripts/util/keystore-cert-import | 13 + .../kvm/discoverer/LibvirtServerDiscoverer.java| 32 +-- .../org/apache/cloudstack/ca/CAManagerImpl.java| 4 +- systemvm/debian/opt/cloud/bin/setup/common.sh | 2 +- test/integration/smoke/test_vm_life_cycle.py | 310 - ui/css/cloudstack3.css | 2 + ui/l10n/en.js | 2 + ui/scripts/system.js | 51 +++- utils/src/main/java/com/cloud/utils/nio/Link.java | 8 +- .../main/java/com/cloud/utils/script/Script.java | 3 +- .../java/com/cloud/utils/ssh/SSHCmdHelper.java | 4 +- .../cloudstack/utils/security/KeyStoreUtils.java | 39 ++- 28 files changed, 754 insertions(+), 118 deletions(-) copy api/src/main/java/com/cloud/agent/api/BadCommand.java => core/src/main/java/org/apache/cloudstack/ca/PostCertificateRenewalCommand.java (83%) create mode 100644 plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtPostCertificateRenewalCommandWrapper.java -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 644b0910cd0c33d55a07dbc95f1d51a288c3c4a3 Merge: fed3492 8da2462 Author: Rohit Yadav AuthorDate: Fri Apr 20 00:42:30 2018 +0530 Merge branch '4.11' Signed-off-by: Rohit Yadav agent/bindir/cloud-setup-agent.in | 12 +- agent/src/main/java/com/cloud/agent/Agent.java | 155 +-- .../src/main/java/com/cloud/agent/AgentShell.java | 7 +- .../src/main/java/com/cloud/agent/IAgentShell.java | 5 + .../virtualnetwork/VirtualRoutingResource.java | 18 +- .../ca/PostCertificateRenewalCommand.java | 34 +++ .../cloudstack/ca/SetupCertificateCommand.java | 6 +- debian/cloudstack-agent.postinst | 1 + .../cloudstack/ca/provider/RootCAProvider.java | 2 +- ...ibvirtPostCertificateRenewalCommandWrapper.java | 52 .../kvm/resource/LibvirtComputingResource.java | 43 ++- .../wrapper/LibvirtMigrateCommandWrapper.java | 20 +- .../LibvirtModifyTargetsCommandWrapper.java| 2 +- .../wrapper/LibvirtMigrateCommandWrapperTest.java | 22 ++ python/lib/cloud_utils.py | 4 +- python/lib/cloudutils/serviceConfig.py | 35 ++- scripts/util/keystore-cert-import | 13 + .../kvm/discoverer/LibvirtServerDiscoverer.java| 32 +-- .../org/apache/cloudstack/ca/CAManagerImpl.java| 4 +- systemvm/debian/opt/cloud/bin/setup/common.sh | 2 +- test/integration/smoke/test_vm_life_cycle.py | 310 - ui/css/cloudstack3.css | 2 + ui/l10n/en.js | 2 + ui/scripts/system.js | 51 +++- utils/src/main/java/com/cloud/utils/nio/Link.java | 8 +- .../main/java/com/cloud/utils/script/Script.java | 3 +- .../java/com/cloud/utils/ssh/SSHCmdHelper.java | 4 +- .../cloudstack/utils/security/KeyStoreUtils.java | 39 ++- 28 files changed, 777 insertions(+), 111 deletions(-) diff --cc core/src/main/java/org/apache/cloudstack/ca/PostCertificateRenewalCommand.java index 000,12df619..12df619 mode 00,100644..100644 --- a/core/src/main/java/org/apache/cloudstack/ca/PostCertificateRenewalCommand.java +++ b/core/src/main/java/org/apache/cloudstack/ca/PostCertificateRenewalCommand.java diff --cc server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java index 02e7a42,000..49484f6 mode 100644,00..100644 --- a/server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java +++ b/server/src/main/java/org/apache/cloudstack/ca/CAManagerImpl.java @@@ -1,431 -1,0 +1,429 @@@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.cloudstack.ca; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.cert.CertificateExpiredException; +import java.security.cert.CertificateNotYetValidException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Arrays; - import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.inject.Inject; +import javax.naming.ConfigurationException; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; + +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.command.admin.ca.IssueCertificateCmd; +import org.apache.cloudstack.api.command.admin.ca.ListCAProvidersCmd; +import org.apache.cloudstack.api.command.admin.ca.ListCaCertificateCmd; +import org.apache.cloudstack.api.command.admin.ca.ProvisionCertificateCmd; +import org.apache.cloudstack.api.command.admin.ca.RevokeCertificateCmd; +import org.apache.cloudstack
[cloudstack] branch master updated (644b091 -> 528e6c6)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 644b091 Merge branch '4.11' add f46518a9 capacity: remove unused threadpool (#2588) new 528e6c6 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../java/com/cloud/capacity/CapacityManagerImpl.java | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 528e6c6dff4fb7fe2dbc89265ef10e8e666de026 Merge: 644b091 f46518a9 Author: Rohit Yadav AuthorDate: Fri Apr 20 00:54:41 2018 +0530 Merge branch '4.11' .../java/com/cloud/capacity/CapacityManagerImpl.java | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: router: Fix routing tables for public IP NAT based access (#2579)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 561630e router: Fix routing tables for public IP NAT based access (#2579) 561630e is described below commit 561630e44991918faf4ea5a999c1cba3d0e140a9 Author: Rohit Yadav AuthorDate: Fri Apr 20 15:29:04 2018 +0530 router: Fix routing tables for public IP NAT based access (#2579) This fixes routing table rule setup regression to correctly router marked packets based on interface related ip route tables. This thereby fixes the access of VMs in the same VPC using NAT/SNAT public IPs. Signed-off-by: Rohit Yadav --- systemvm/debian/opt/cloud/bin/configure.py| 4 ++-- systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 12 +--- systemvm/debian/opt/cloud/bin/cs/CsRoute.py | 7 +-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/configure.py b/systemvm/debian/opt/cloud/bin/configure.py index b94333f..f9247ad 100755 --- a/systemvm/debian/opt/cloud/bin/configure.py +++ b/systemvm/debian/opt/cloud/bin/configure.py @@ -926,8 +926,8 @@ class CsForwardingRules(CsDataBag): "-I PREROUTING -s %s/32 -m state --state NEW -j CONNMARK --save-mark --nfmask 0x --ctmask 0x" % rule["internal_ip"]]) self.fw.append(["mangle", "", -"-I PREROUTING -s %s/32 -m state --state NEW -j MARK --set-xmark 0x%s/0x" % -(rule["internal_ip"], device[len("eth"):])]) +"-I PREROUTING -s %s/32 -m state --state NEW -j MARK --set-xmark %s/0x" % +(rule["internal_ip"], hex(int(device[len("eth"):])))]) self.fw.append(["nat", "front", "-A PREROUTING -d %s/32 -j DNAT --to-destination %s" % (rule["public_ip"], rule["internal_ip"])]) self.fw.append(["nat", "front", diff --git a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py index dbafa1d..8df5162 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py @@ -297,9 +297,7 @@ class CsIP: interfaces = [CsInterface(address, self.config)] CsHelper.reconfigure_interfaces(self.cl, interfaces) -if not self.config.is_vpc() and (self.get_type() in ['public']): -self.set_mark() -if self.config.is_vpc() and (self.get_type() in ['public']): +if self.get_type() in ['public']: self.set_mark() if 'gateway' in self.address: @@ -363,6 +361,7 @@ class CsIP: def fw_router(self): if self.config.is_vpc(): return + self.fw.append(["mangle", "front", "-A PREROUTING " + "-m state --state RELATED,ESTABLISHED " + "-j CONNMARK --restore-mark --nfmask 0x --ctmask 0x"]) @@ -534,6 +533,13 @@ class CsIP: if self.config.is_vpc(): if self.get_type() in ["public"] and "gateway" in self.address and self.address["gateway"] != "None": route.add_route(self.dev, self.address["gateway"]) +for inf, addresses in self.config.address().dbag.iteritems(): +if not inf.startswith("eth"): +continue +for address in addresses: +if "nw_type" in address and address["nw_type"] == "guest": +route.add_network_route(self.dev, str(address["network"])) + route.add_network_route(self.dev, str(self.address["network"])) CsHelper.execute("sudo ip route flush cache") diff --git a/systemvm/debian/opt/cloud/bin/cs/CsRoute.py b/systemvm/debian/opt/cloud/bin/cs/CsRoute.py index 02cc881..74544d9 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsRoute.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsRoute.py @@ -62,13 +62,16 @@ class CsRoute: table = self.get_tablename(dev) logging.info("Adding route: dev " + dev + " table: " + table + " network: " + address + " if not present") -cmd = "dev %s table %s throw %s proto static" % (dev, table, address) +cmd = "throw %s table %s proto stati
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 71ab3aff9a43fe6df82dc98ba499b532fea3a44d Merge: 528e6c6 561630e Author: Rohit Yadav AuthorDate: Fri Apr 20 15:29:44 2018 +0530 Merge branch '4.11' PULL_REQUEST_TEMPLATE.md | 2 -- systemvm/debian/opt/cloud/bin/configure.py| 4 ++-- systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 12 +--- systemvm/debian/opt/cloud/bin/cs/CsRoute.py | 7 +-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --cc PULL_REQUEST_TEMPLATE.md index dafbcb0,17adfe6..cf1f6a2 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@@ -34,10 -34,6 +34,8 @@@ - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. +Testing - [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. +- [ ] All relevant new and existing integration tests have passed. +- [ ] A full integration testsuite with all test that can run on my environment has passed. - - @blueorangutan package -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated (528e6c6 -> 71ab3af)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 528e6c6 Merge branch '4.11' add 256dd90 Remove packaging job from pull request template (#2589) add 561630e router: Fix routing tables for public IP NAT based access (#2579) new 71ab3af Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: PULL_REQUEST_TEMPLATE.md | 2 -- systemvm/debian/opt/cloud/bin/configure.py| 4 ++-- systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 12 +--- systemvm/debian/opt/cloud/bin/cs/CsRoute.py | 7 +-- 4 files changed, 16 insertions(+), 9 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: schema: fix create table only if not exists and remove drop table statements (#2582)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new b5abdd3 schema: fix create table only if not exists and remove drop table statements (#2582) b5abdd3 is described below commit b5abdd306e45d442b1224ecc68df621d56e79455 Author: ernjvr AuthorDate: Fri Apr 20 15:28:12 2018 +0200 schema: fix create table only if not exists and remove drop table statements (#2582) --- engine/schema/resources/META-INF/db/schema-41000to41100.sql | 5 ++--- engine/schema/resources/META-INF/db/schema-452to460.sql | 5 ++--- engine/schema/resources/META-INF/db/schema-4930to41000.sql | 8 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/engine/schema/resources/META-INF/db/schema-41000to41100.sql b/engine/schema/resources/META-INF/db/schema-41000to41100.sql index 4dc11d4..b3efce4 100644 --- a/engine/schema/resources/META-INF/db/schema-41000to41100.sql +++ b/engine/schema/resources/META-INF/db/schema-41000to41100.sql @@ -392,7 +392,7 @@ CREATE VIEW `cloud`.`volume_view` AS `cloud`.`domain` resource_tag_domain ON resource_tag_domain.id = resource_tags.domain_id; -- Extra Dhcp Options -CREATE TABLE IF NOT EXISTS `cloud`.`nic_extra_dhcp_options` ( +CREATE TABLE IF NOT EXISTS `cloud`.`nic_extra_dhcp_options` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `uuid` varchar(255) UNIQUE, `nic_id` bigint unsigned NOT NULL COMMENT ' nic id where dhcp options are applied', @@ -427,8 +427,7 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervi INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.2.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.1.0' AND guest_os_id not in (1,2,3,4,56,101,56,58,93,94,50,51,87,88,89,90,91,92,26,27,28,29,40,41,42,43,44,45,96,97,107,108,109,110,151,152,153); -- Add table to track primary storage in use for snapshots -DROP TABLE IF EXISTS `cloud_usage`.`usage_snapshot_on_primary`; -CREATE TABLE `cloud_usage`.`usage_snapshot_on_primary` ( +CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_snapshot_on_primary` ( `id` bigint(20) unsigned NOT NULL, `zone_id` bigint(20) unsigned NOT NULL, `account_id` bigint(20) unsigned NOT NULL, diff --git a/engine/schema/resources/META-INF/db/schema-452to460.sql b/engine/schema/resources/META-INF/db/schema-452to460.sql index 1989b6c..ace22e4 100644 --- a/engine/schema/resources/META-INF/db/schema-452to460.sql +++ b/engine/schema/resources/META-INF/db/schema-452to460.sql @@ -385,8 +385,7 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'Netwo UPDATE IGNORE `cloud`.`configuration` SET `value`="PLAINTEXT" WHERE `name`="user.authenticators.exclude"; -DROP TABLE IF EXISTS `cloud`.`external_bigswitch_vns_devices`; -CREATE TABLE `cloud`.`external_bigswitch_bcf_devices` ( +CREATE TABLE IF NOT EXISTS `cloud`.`external_bigswitch_bcf_devices` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `uuid` varchar(255) UNIQUE, `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which bigswitch bcf device is added', @@ -405,7 +404,7 @@ CREATE TABLE `cloud`.`external_bigswitch_bcf_devices` ( UPDATE `cloud`.`host` SET `resource`='com.cloud.hypervisor.xenserver.resource.XenServer600Resource' WHERE `resource`='com.cloud.hypervisor.xenserver.resource.XenServer602Resource'; -CREATE TABLE `cloud`.`ldap_trust_map` ( +CREATE TABLE IF NOT EXISTS `cloud`.`ldap_trust_map` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `domain_id` bigint unsigned NOT NULL, `type` varchar(10) NOT NULL, diff --git a/engine/schema/resources/META-INF/db/schema-4930to41000.sql b/engine/schema/resources/META-INF/db/schema-4930to41000.sql index dbea77d..dc0cd6d 100644 --- a/engine/schema/resources/META-INF/db/schema-4930to41000.sql +++ b/engine/schema/resources/META-INF/db/schema-4930to41000.sql @@ -111,7 +111,7 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervi INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 7.2', 274, now(), 0); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Other PV Vi
[cloudstack] branch master updated (71ab3af -> 9187392)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 71ab3af Merge branch '4.11' add 995775d Prevent NPE if guest OS mapping is missing while prioritizing hosts (#2577) add b5abdd3 schema: fix create table only if not exists and remove drop table statements (#2582) new 9187392 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../src/main/resources/META-INF/db/schema-41000to41100.sql| 5 ++--- .../schema/src/main/resources/META-INF/db/schema-452to460.sql | 5 ++--- .../src/main/resources/META-INF/db/schema-4930to41000.sql | 8 .../cloud/agent/manager/allocator/impl/FirstFitAllocator.java | 11 +++ 4 files changed, 19 insertions(+), 10 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 9187392ff9cd33b53d5b251076fee22b02743477 Merge: 71ab3af b5abdd3 Author: Rohit Yadav AuthorDate: Fri Apr 20 19:02:40 2018 +0530 Merge branch '4.11' .../src/main/resources/META-INF/db/schema-41000to41100.sql| 5 ++--- .../schema/src/main/resources/META-INF/db/schema-452to460.sql | 5 ++--- .../src/main/resources/META-INF/db/schema-4930to41000.sql | 8 .../cloud/agent/manager/allocator/impl/FirstFitAllocator.java | 11 +++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --cc engine/schema/src/main/resources/META-INF/db/schema-41000to41100.sql index 13a92ae,000..2db644f mode 100644,00..100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-41000to41100.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-41000to41100.sql @@@ -1,611 -1,0 +1,610 @@@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 4.10.0.0 to 4.11.0.0 +--; + +--; +-- Stored procedure to do idempotent column add; +--; +DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_COLUMN`; + +CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_COLUMN` ( + IN in_table_name VARCHAR(200) +, IN in_column_name VARCHAR(200) +, IN in_column_definition VARCHAR(1000) +) +BEGIN + +DECLARE CONTINUE HANDLER FOR 1060 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', 'ADD COLUMN') ; SET @ddl = CONCAT(@ddl, ' ', in_column_name); SET @ddl = CONCAT(@ddl, ' ', in_column_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; + +DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`; + +CREATE PROCEDURE `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY` ( + IN in_table_name VARCHAR(200) +, IN in_foreign_key_name VARCHAR(200) +) +BEGIN + +DECLARE CONTINUE HANDLER FOR 1091 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', ' DROP FOREIGN KEY '); SET @ddl = CONCAT(@ddl, ' ', in_foreign_key_name); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; + +DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_DROP_INDEX`; + +CREATE PROCEDURE `cloud`.`IDEMPOTENT_DROP_INDEX` ( + IN in_index_name VARCHAR(200) +, IN in_table_name VARCHAR(200) +) +BEGIN + +DECLARE CONTINUE HANDLER FOR 1091 BEGIN END; SET @ddl = CONCAT('DROP INDEX ', in_index_name); SET @ddl = CONCAT(@ddl, ' ', ' ON ') ; SET @ddl = CONCAT(@ddl, ' ', in_table_name); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; + +DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_CREATE_UNIQUE_INDEX`; + +CREATE PROCEDURE `cloud`.`IDEMPOTENT_CREATE_UNIQUE_INDEX` ( + IN in_index_name VARCHAR(200) +, IN in_table_name VARCHAR(200) +, IN in_index_definition VARCHAR(1000) +) +BEGIN + +DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT('CREATE UNIQUE INDEX ', in_index_name); SET @ddl = CONCAT(@ddl, ' ', ' ON ') ; SET @ddl = CONCAT(@ddl, ' ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', in_index_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; + +-- Add For VPC flag +CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.network_offerings','for_vpc', 'INT(1) NOT NULL DEFAULT 0'); + +UPDATE cloud.network_offerings o +SET for_vpc = 1 +where + o.conserve_mode = 0 + and o.guest_type = 'Isolated' + and exists( +SELECT id +from cloud.ntwk_offering_service_map +where network_offering_id = o.id and ( + provider in ('VpcVirtualRouter', 'InternalLbVm', 'JuniperContrailVpcRouter') + or service in ('NetworkACL') +) + ); + +UPDATE `cloud`.`configuration` SET value = '600'
[cloudstack-cloudmonkey] branch master updated: cmd: introduce poc text and table outputs
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git The following commit(s) were added to refs/heads/master by this push: new cb70f1f cmd: introduce poc text and table outputs cb70f1f is described below commit cb70f1fe32c7fb785874f1b8c0170d63bb87d9ec Author: Rohit Yadav AuthorDate: Sat Apr 21 22:24:17 2018 +0530 cmd: introduce poc text and table outputs Signed-off-by: Rohit Yadav --- cmd/api.go | 75 +- config/config.go |1 + .../github.com/olekukonko/tablewriter/LICENCE.md | 19 + vendor/github.com/olekukonko/tablewriter/README.md | 277 + vendor/github.com/olekukonko/tablewriter/csv.go| 52 + .../olekukonko/tablewriter/csv2table/README.md | 43 + .../olekukonko/tablewriter/csv2table/csv2table.go | 85 ++ vendor/github.com/olekukonko/tablewriter/table.go | 839 .../olekukonko/tablewriter/table_test.go | 1055 .../olekukonko/tablewriter/table_with_color.go | 134 +++ vendor/github.com/olekukonko/tablewriter/util.go | 78 ++ vendor/github.com/olekukonko/tablewriter/wrap.go | 99 ++ .../github.com/olekukonko/tablewriter/wrap_test.go | 58 ++ 13 files changed, 2811 insertions(+), 4 deletions(-) diff --git a/cmd/api.go b/cmd/api.go index 215e58c..7bb6f43 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -22,6 +22,12 @@ import ( "errors" "fmt" "strings" + + "cloudmonkey/config" + "github.com/olekukonko/tablewriter" + "os" + "reflect" + "sort" ) var apiCommand *Command @@ -31,6 +37,28 @@ func GetAPIHandler() *Command { return apiCommand } +func printText(itemMap map[string]interface{}) { + for k, v := range itemMap { + valueType := reflect.TypeOf(v) + if valueType.Kind() == reflect.Slice { + fmt.Printf("%s:\n", k) + for _, item := range v.([]interface{}) { + row, isMap := item.(map[string]interface{}) + if isMap { + for field, value := range row { + fmt.Printf("%s = %v\n", field, value) + } + } else { + fmt.Printf("%v\n", item) + } + fmt.Println("") + } + } else { + fmt.Printf("%s = %v\n", k, v) + } + } +} + func init() { apiCommand = &Command{ Name: "api", @@ -77,15 +105,54 @@ func init() { return nil } - b, err := NewAPIRequest(r, api.Name, apiArgs) + response, err := NewAPIRequest(r, api.Name, apiArgs) if err != nil { return err } - response, _ := json.MarshalIndent(b, "", " ") + switch r.Config.Core.Output { + case config.TABLE: + table := tablewriter.NewWriter(os.Stdout) + for k, v := range response { + valueType := reflect.TypeOf(v) + if valueType.Kind() == reflect.Slice { + items, ok := v.([]interface{}) + if !ok { + continue + } + fmt.Printf("%s:\n", k) + var header []string + for _, item := range items { + row, ok := item.(map[string]interface{}) + if !ok || len(row) < 1 { + continue + } + + if len(header) == 0 { + for field, _ := range row { + heade
[cloudstack-docs-admin] branch 4.11 updated: sg: netfilters setting for security groups
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-admin.git The following commit(s) were added to refs/heads/4.11 by this push: new ea1edc3 sg: netfilters setting for security groups ea1edc3 is described below commit ea1edc31b25c94471a7abb15385ae3b33c45a69b Author: Rohit Yadav AuthorDate: Sun Apr 22 10:19:24 2018 +0530 sg: netfilters setting for security groups Signed-off-by: Rohit Yadav --- source/networking/security_groups.rst | 12 1 file changed, 12 insertions(+) diff --git a/source/networking/security_groups.rst b/source/networking/security_groups.rst index 8ef58b8..262e6dd 100644 --- a/source/networking/security_groups.rst +++ b/source/networking/security_groups.rst @@ -86,6 +86,18 @@ advanced zone where KVM is the hypervisor. Using security groups in advanced zones rather than multiple VLANs allows a greater range of options for setting up guest isolation in a cloud. +Setting for CentOS +^^ + +To use security groups on CentOS/RHEL/Fedora please enable bridge based +filtering, ensure that default sysctl configuration file usually at +/usr/lib/sysctl.d/00-system.conf set to following and run 'sysctl -p': + +.. note:: + # Enable netfilter on bridges. + net.bridge.bridge-nf-call-ip6tables = 1 + net.bridge.bridge-nf-call-iptables = 1 + net.bridge.bridge-nf-call-arptables = 1 Limitations ^^^ -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-admin] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-admin.git commit 7fd1bda4870939fd3c1ae52f29b30c5427cbde64 Merge: 5869753 ea1edc3 Author: Rohit Yadav AuthorDate: Sun Apr 22 10:30:40 2018 +0530 Merge branch '4.11' source/networking/security_groups.rst | 12 1 file changed, 12 insertions(+) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-admin] branch master updated (5869753 -> 7fd1bda)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-admin.git. from 5869753 Forward merge branch '4.11' (PR #51) add a1a1a91 Merge pull request #51 from rafaelweingartner/updateRefSShKeysSetupScript add ea1edc3 sg: netfilters setting for security groups new 7fd1bda Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: source/networking/security_groups.rst | 12 1 file changed, 12 insertions(+) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: network: Fix security groups for CentOS (#2590)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new ea55a00 network: Fix security groups for CentOS (#2590) ea55a00 is described below commit ea55a002cf9669b70ac47bdbe270dd78301bc328 Author: Rohit Yadav AuthorDate: Mon Apr 23 16:54:03 2018 +0200 network: Fix security groups for CentOS (#2590) On RHEL/CentOS/Fedora the bridge related sysctl rules are enabled in kernel by default but can only be disabled. Enabling those keys will fail, causing iptables/ebtables tables to not be created and fails SG on CentOS. This also fixes an integration test case, which assumes first few tests complete within 3 minutes. In nested env the value may be large, this increases the value to 20 minutes. Signed-off-by: Rohit Yadav --- scripts/vm/network/security_group.py | 3 +-- test/integration/smoke/test_routers.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py index 6a11057..19aa735 100755 --- a/scripts/vm/network/security_group.py +++ b/scripts/vm/network/security_group.py @@ -1154,8 +1154,7 @@ def addFWFramework(brname): execute("sysctl -w net.bridge.bridge-nf-call-iptables=1") execute("sysctl -w net.bridge.bridge-nf-call-ip6tables=1") except: -logging.debug("failed to turn on bridge netfilter") -return False +logging.warn("failed to turn on bridge netfilter") brfw = getBrfw(brname) try: diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index dfd5916..f84afdb 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -521,9 +521,9 @@ class TestRouterServices(cloudstackTestCase): ) if str(result[3]) == "min,": self.assertEqual( -(int(result[2]) < 3), +(int(result[2]) < 20), True, -"Check uptime is less than 3 mins or not" +"Check uptime is less than 20 mins or not" ) else: self.assertEqual( -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: CLOUDSTACK-10327: Do not invalidate the session when an API command is not available (#2498)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 9a13227 CLOUDSTACK-10327: Do not invalidate the session when an API command is not available (#2498) 9a13227 is described below commit 9a13227a78acb14d9fd4f9ad5246ce67396cef7a Author: Olivier Lemasle AuthorDate: Tue Apr 24 15:01:19 2018 +0200 CLOUDSTACK-10327: Do not invalidate the session when an API command is not available (#2498) CloudStack SSO (using security.singlesignon.key) does not work anymore with CloudStack 4.11, since commit 9988c26, which introduced a regression due to a refactoring: every API request that is not "validated" generates the same error (401 - Unauthorized) and invalidates the session. However, CloudStack UI executes a call to listConfigurations in method bypassLoginCheck. A non-admin user does not have the permissions to execute this request, which causes an error 401: {"listconfigurationsresponse":{"uuidList":[],"errorcode":401,"errortext":"unable to verify user credentials and/or request signature"}} The session (already created by SSO) is then invalidated and the user cannot access to CloudStack UI (error "Session Expired"). Before 9988c26 (up to CloudStack 4.10), an error 432 was returned (and ignored): {"errorresponse":{"uuidList":[],"errorcode":432,"cserrorcode":,"errortext":"The user is not allowed to request the API command or the API command does not exist"}} Even if the call to listConfigurations was removed, another call to listIdps also lead to an error 401 for user accounts if the SAML plugin is not enabled. This pull request aims to fix the SSO issue, by restoring errors 432 (instead of 401 + invalidate session) for commands not available. However, if an API command is explicitly denied using ACLs or if the session key is incorrect, it still generates an error 401 and invalidates the session. --- .../exception/UnavailableCommandException.java | 36 ++ .../acl/DynamicRoleBasedAPIAccessChecker.java | 7 ++--- .../acl/StaticRoleBasedAPIAccessChecker.java | 14 - server/src/com/cloud/api/ApiServer.java| 4 +++ .../java/com/cloud/utils/SerialVersionUID.java | 1 + 5 files changed, 57 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/com/cloud/exception/UnavailableCommandException.java b/api/src/main/java/com/cloud/exception/UnavailableCommandException.java new file mode 100644 index 000..d5b7faa --- /dev/null +++ b/api/src/main/java/com/cloud/exception/UnavailableCommandException.java @@ -0,0 +1,36 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.exception; + +import com.cloud.utils.SerialVersionUID; + +public class UnavailableCommandException extends PermissionDeniedException { + +private static final long serialVersionUID = SerialVersionUID.UnavailableCommandException; + +protected UnavailableCommandException() { +super(); +} + +public UnavailableCommandException(String msg) { +super(msg); +} + +public UnavailableCommandException(String msg, Throwable cause) { +super(msg, cause); +} +} diff --git a/plugins/acl/dynamic-role-based/src/org/apache/cloudstack/acl/DynamicRoleBasedAPIAccessChecker.java b/plugins/acl/dynamic-role-based/src/org/apache/cloudstack/acl/DynamicRoleBasedAPIAccessChecker.java index 3dfdb01..d10c191 100644 --- a/plugins/acl/dynamic-role-based/src/org/apache/cloudstack/acl/DynamicRoleBasedAPIAccessChecker.java +++ b/plugins/acl/dynamic-role-based/src/org/apache/cloudstack/acl/DynamicRoleBasedAPIAccessChecker.java @@ -25,6 +25,7 @@ import java.util.Set; import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.exception.UnavailableCommandException; import org.apache.cloudstack.api.APICommand; import com.cloud.exceptio
[cloudstack] branch master updated (f8b6375 -> 5ff2f17)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from f8b6375 CLOUDSTACK-10359: Change the inconsistent method names. (#2591) add ea55a00 network: Fix security groups for CentOS (#2590) add 9a13227 CLOUDSTACK-10327: Do not invalidate the session when an API command is not available (#2498) new 5ff2f17 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ...mitException.java => UnavailableCommandException.java} | 15 +-- .../cloudstack/acl/DynamicRoleBasedAPIAccessChecker.java | 7 +++ .../cloudstack/acl/StaticRoleBasedAPIAccessChecker.java | 14 +- scripts/vm/network/security_group.py | 3 +-- server/src/main/java/com/cloud/api/ApiServer.java | 4 test/integration/smoke/test_routers.py| 4 ++-- utils/src/main/java/com/cloud/utils/SerialVersionUID.java | 1 + 7 files changed, 29 insertions(+), 19 deletions(-) copy api/src/main/java/com/cloud/exception/{RequestLimitException.java => UnavailableCommandException.java} (75%) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 5ff2f172cbf0a77b4fb3c0061260de548ae80c37 Merge: f8b6375 9a13227 Author: Rohit Yadav AuthorDate: Tue Apr 24 15:05:38 2018 +0200 Merge branch '4.11' .../exception/UnavailableCommandException.java | 36 ++ .../acl/DynamicRoleBasedAPIAccessChecker.java | 7 ++--- .../acl/StaticRoleBasedAPIAccessChecker.java | 14 - scripts/vm/network/security_group.py | 3 +- server/src/main/java/com/cloud/api/ApiServer.java | 4 +++ test/integration/smoke/test_routers.py | 4 +-- .../java/com/cloud/utils/SerialVersionUID.java | 1 + 7 files changed, 60 insertions(+), 9 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] branch master updated (cb70f1f -> 463384e)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git. from cb70f1f cmd: introduce poc text and table outputs new 1a06716 cache: add API response keys in API cache for filter options new 48cda52 completer: use response keys to show filter options new 95bb688 set: display server profile details when profile is `set` new 9476afa help: don't display the 'fake' filter option in api help doc new 5622137 api: wip refactor output code, using output type, response and filter opts new 463384e vendor: add missing go-runewidth dependency The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: cli/completer.go |8 + cmd/api.go | 105 +- cmd/help.go|5 + cmd/set.go |8 + config/cache.go| 19 +- config/config.go |2 - .../mattn/{go-colorable => go-runewidth}/LICENSE |0 vendor/github.com/mattn/go-runewidth/README.mkd| 27 + vendor/github.com/mattn/go-runewidth/runewidth.go | 1235 .../github.com/mattn/go-runewidth/runewidth_js.go |8 + .../mattn/go-runewidth/runewidth_posix.go | 77 ++ .../mattn/go-runewidth/runewidth_posix_test.go | 78 ++ .../mattn/go-runewidth/runewidth_test.go | 297 + .../mattn/go-runewidth/runewidth_windows.go| 25 + 14 files changed, 1848 insertions(+), 46 deletions(-) copy vendor/github.com/mattn/{go-colorable => go-runewidth}/LICENSE (100%) create mode 100644 vendor/github.com/mattn/go-runewidth/README.mkd create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth.go create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_js.go create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_posix.go create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_posix_test.go create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_test.go create mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_windows.go -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 03/06: set: display server profile details when profile is `set`
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 95bb688d89a298196ca4a02b653434f01d964c71 Author: Rohit Yadav AuthorDate: Sun Apr 22 20:58:23 2018 +0530 set: display server profile details when profile is `set` Signed-off-by: Rohit Yadav --- cmd/set.go | 8 1 file changed, 8 insertions(+) diff --git a/cmd/set.go b/cmd/set.go index 5c66f1b..961decb 100644 --- a/cmd/set.go +++ b/cmd/set.go @@ -49,6 +49,14 @@ func init() { r.Config.UpdateConfig(subCommand, value) if subCommand == "profile" && r.Shell != nil { + fmt.Println("Loaded server profile:", r.Config.Core.ProfileName) + fmt.Println("Url:", r.Config.ActiveProfile.URL) + fmt.Println("Username: ", r.Config.ActiveProfile.Username) + fmt.Println("Domain: ", r.Config.ActiveProfile.Domain) + fmt.Println("API Key:", r.Config.ActiveProfile.APIKey) + fmt.Println("Verify Cert:", r.Config.ActiveProfile.VerifyCert) + fmt.Println() + r.Shell.SetPrompt(r.Config.GetPrompt()) } return nil -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 02/06: completer: use response keys to show filter options
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 48cda52f5efd1cc23fb55cac111ce3f457d3adad Author: Rohit Yadav AuthorDate: Sun Apr 22 20:57:55 2018 +0530 completer: use response keys to show filter options Signed-off-by: Rohit Yadav --- cli/completer.go | 8 1 file changed, 8 insertions(+) diff --git a/cli/completer.go b/cli/completer.go index 2444fd2..9fb8bd8 100644 --- a/cli/completer.go +++ b/cli/completer.go @@ -173,6 +173,14 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int) offset = 0 return } + if arg.Type == config.FAKE && arg.Name == "filter=" { + options = [][]rune{} + offset = 0 + for _, key := range apiFound.ResponseKeys { + options = append(options, []rune(key)) + } + return + } argName := strings.Replace(arg.Name, "=", "", -1) var autocompleteAPI *config.API -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 04/06: help: don't display the 'fake' filter option in api help doc
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 9476afa87d8d6e681cebad52742a6409f176e344 Author: Rohit Yadav AuthorDate: Sun Apr 22 20:59:05 2018 +0530 help: don't display the 'fake' filter option in api help doc Signed-off-by: Rohit Yadav --- cmd/help.go | 5 + config/config.go | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/help.go b/cmd/help.go index d027510..24f654b 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -21,6 +21,8 @@ import ( "errors" "fmt" "strings" + + "cloudmonkey/config" ) var helpCommand *Command @@ -56,6 +58,9 @@ func init() { fmt.Printf("%-24s %-8s %s\n", "==", "", "===") } for _, arg := range api.Args { + if arg.Type == config.FAKE { + continue + } fmt.Printf("\033[36m%-24s\033[0m \033[32m%-8s\033[0m ", strings.Replace(arg.Name, "=", "", -1), arg.Type) info := []rune(arg.Description) for i, r := range info { diff --git a/config/config.go b/config/config.go index 429fd4c..16bda15 100644 --- a/config/config.go +++ b/config/config.go @@ -218,8 +218,6 @@ func (c *Config) UpdateConfig(key string, value string) { c.ActiveProfile.SecretKey = value case "verifycert": c.ActiveProfile.VerifyCert = value == "true" - default: - return } reloadConfig(c) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-cloudmonkey] 06/06: vendor: add missing go-runewidth dependency
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 463384e5fbdef8dd555a6677df7809dea567f367 Author: Rohit Yadav AuthorDate: Wed Apr 25 16:56:44 2018 +0200 vendor: add missing go-runewidth dependency Signed-off-by: Rohit Yadav --- vendor/github.com/mattn/go-runewidth/LICENSE | 21 + vendor/github.com/mattn/go-runewidth/README.mkd| 27 + vendor/github.com/mattn/go-runewidth/runewidth.go | 1235 .../github.com/mattn/go-runewidth/runewidth_js.go |8 + .../mattn/go-runewidth/runewidth_posix.go | 77 ++ .../mattn/go-runewidth/runewidth_posix_test.go | 78 ++ .../mattn/go-runewidth/runewidth_test.go | 297 + .../mattn/go-runewidth/runewidth_windows.go| 25 + 8 files changed, 1768 insertions(+) diff --git a/vendor/github.com/mattn/go-runewidth/LICENSE b/vendor/github.com/mattn/go-runewidth/LICENSE new file mode 100644 index 000..91b5cef --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Yasuhiro Matsumoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/mattn/go-runewidth/README.mkd b/vendor/github.com/mattn/go-runewidth/README.mkd new file mode 100644 index 000..3a9 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/README.mkd @@ -0,0 +1,27 @@ +go-runewidth + + +[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) +[![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD) +[![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) +[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) + +Provides functions to get fixed width of the character or string. + +Usage +- + +```go +runewidth.StringWidth("つのだ☆HIRO") == 12 +``` + + +Author +-- + +Yasuhiro Matsumoto + +License +--- + +under the MIT License: http://mattn.mit-license.org/2013 diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go new file mode 100644 index 000..82568a1 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -0,0 +1,1235 @@ +package runewidth + +import "os" + +var ( + // EastAsianWidth will be set true if the current locale is CJK + EastAsianWidth bool + + // DefaultCondition is a condition in current locale + DefaultCondition = &Condition{EastAsianWidth} +) + +func init() { + env := os.Getenv("RUNEWIDTH_EASTASIAN") + if env == "" { + EastAsianWidth = IsEastAsian() + } else { + EastAsianWidth = env == "1" + } +} + +type interval struct { + first rune + last rune +} + +type table []interval + +func inTables(r rune, ts ...table) bool { + for _, t := range ts { + if inTable(r, t) { + return true + } + } + return false +} + +func inTable(r rune, t table) bool { + // func (t table) IncludesRune(r rune) bool { + if r < t[0].first { + return false + } + + bot := 0 + top := len(t) - 1 + for top >= bot { + mid := (bot + top) / 2 + + switch { + case t[mid].last < r: + bot = mid + 1 + case t[mid].first > r: + top = mid - 1 + default: + return true + } + } + + ret
[cloudstack-cloudmonkey] 05/06: api: wip refactor output code, using output type, response and filter opts
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 56221379a199e463c84856443cf32a27d4d35687 Author: Rohit Yadav AuthorDate: Sun Apr 22 20:59:33 2018 +0530 api: wip refactor output code, using output type, response and filter opts Signed-off-by: Rohit Yadav --- cmd/api.go | 105 - 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/cmd/api.go b/cmd/api.go index 7bb6f43..c13a2c8 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -21,13 +21,13 @@ import ( "encoding/json" "errors" "fmt" - "strings" - - "cloudmonkey/config" "github.com/olekukonko/tablewriter" "os" "reflect" "sort" + "strings" + + "cloudmonkey/config" ) var apiCommand *Command @@ -59,6 +59,59 @@ func printText(itemMap map[string]interface{}) { } } +func printResult(outputType string, response map[string]interface{}, filter []string) { + switch outputType { + case config.TABLE: + table := tablewriter.NewWriter(os.Stdout) + for k, v := range response { + valueType := reflect.TypeOf(v) + if valueType.Kind() == reflect.Slice { + items, ok := v.([]interface{}) + if !ok { + continue + } + fmt.Printf("%s:\n", k) + var header []string + for _, item := range items { + row, ok := item.(map[string]interface{}) + if !ok || len(row) < 1 { + continue + } + + if len(header) == 0 { + for field, _ := range row { + if filter != nil && len(filter) > 0 { + for _, filterKey := range filter { + if filterKey == field { + header = append(header, field) + } + } + continue + } + header = append(header, field) + } + sort.Strings(header) + table.SetHeader(header) + } + var rowArray []string + for _, field := range header { + rowArray = append(rowArray, fmt.Sprintf("%v", row[field])) + } + table.Append(rowArray) + } + } else { + fmt.Printf("%s = %v\n", k, v) + } + } + table.Render() + case config.TEXT: + printText(response) + default: + jsonOutput, _ := json.MarshalIndent(response, "", " ") + fmt.Println(string(jsonOutput)) + } +} + func init() { apiCommand = &Command{ Name: "api", @@ -110,49 +163,15 @@ func init() { return err } - switch r.Config.Core.Output { - case config.TABLE: - table := tablewriter.NewWriter(os.Stdout) - for k, v := range response { - valueType := reflect.TypeOf(v) - if valueType.Kind() == reflect.Slice { - items, ok := v.([]interface{}) - if !ok { - continue - } - fmt.Printf("%s:\n", k) -
[cloudstack-cloudmonkey] 01/06: cache: add API response keys in API cache for filter options
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git commit 1a06716e10b732f0c28b38535fe57a33f021653b Author: Rohit Yadav AuthorDate: Sun Apr 22 20:57:19 2018 +0530 cache: add API response keys in API cache for filter options Signed-off-by: Rohit Yadav --- config/cache.go | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/cache.go b/config/cache.go index a037a95..8fc9089 100644 --- a/config/cache.go +++ b/config/cache.go @@ -26,6 +26,8 @@ import ( "unicode" ) +const FAKE = "fake" + // APIArg are the args passable to an API type APIArg struct { Namestring @@ -46,7 +48,7 @@ type API struct { Related []string Asyncbool Description string - ResponseName string + ResponseKeys []string } var apiCache map[string]*API @@ -138,10 +140,24 @@ func (c *Config) UpdateCache(response map[string]interface{}) interface{} { }) } + // Add filter arg + apiArgs = append(apiArgs, &APIArg{ + Name:"filter=", + Type:FAKE, + Description: "cloudmonkey specific response key filtering", + }) + sort.Slice(apiArgs, func(i, j int) bool { return apiArgs[i].Name < apiArgs[j].Name }) + var responseKeys []string + for _, respNode := range api["response"].([]interface{}) { + if resp, ok := respNode.(map[string]interface{}); ok { + responseKeys = append(responseKeys, fmt.Sprintf("%v,", resp["name"])) + } + } + var requiredArgs []string for _, arg := range apiArgs { if arg.Required { @@ -157,6 +173,7 @@ func (c *Config) UpdateCache(response map[string]interface{}) interface{} { RequiredArgs: requiredArgs, Async:isAsync, Description: description, + ResponseKeys: responseKeys, } } return count -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: CLOUDSTACK-9677: Adding storage policy support for swift as secondary storage (#2412)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new b6d420b CLOUDSTACK-9677: Adding storage policy support for swift as secondary storage (#2412) b6d420b is described below commit b6d420bec3b4cb02651cffd43502ed880f100bef Author: Khosrow Moossavi AuthorDate: Wed Apr 25 18:42:15 2018 -0400 CLOUDSTACK-9677: Adding storage policy support for swift as secondary storage (#2412) Original-Author: @pdube on PR Fixes #1830. --- api/src/com/cloud/agent/api/to/SwiftTO.java| 9 +- .../org/apache/cloudstack/api/ApiConstants.java| 1 + .../resource/XenServerStorageProcessor.java| 115 + .../resource/XenServerStorageProcessorTest.java| 113 + .../driver/SwiftImageStoreDriverImpl.java | 2 +- scripts/storage/secondary/swift| 21 ++- scripts/vm/hypervisor/xenserver/swift | 21 ++- ui/l10n/en.js | 1 + ui/scripts/system.js | 29 +++- utils/src/main/java/com/cloud/utils/SwiftUtil.java | 187 +++-- .../test/java/com/cloud/utils/SwiftUtilTest.java | 150 - 11 files changed, 499 insertions(+), 150 deletions(-) diff --git a/api/src/com/cloud/agent/api/to/SwiftTO.java b/api/src/com/cloud/agent/api/to/SwiftTO.java index c7a9866..b89dfea 100644 --- a/api/src/com/cloud/agent/api/to/SwiftTO.java +++ b/api/src/com/cloud/agent/api/to/SwiftTO.java @@ -26,17 +26,19 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg { String userName; String key; +String storagePolicy; private static final String pathSeparator = "/"; public SwiftTO() { } -public SwiftTO(Long id, String url, String account, String userName, String key) { +public SwiftTO(Long id, String url, String account, String userName, String key, String storagePolicy) { this.id = id; this.url = url; this.account = account; this.userName = userName; this.key = key; +this.storagePolicy = storagePolicy; } public Long getId() { @@ -64,6 +66,11 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg { } @Override +public String getStoragePolicy() { +return this.storagePolicy; +} + +@Override public DataStoreRole getRole() { return DataStoreRole.Image; } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index d9090b8..dfe9b30 100644 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -287,6 +287,7 @@ public class ApiConstants { public static final String STATE = "state"; public static final String STATUS = "status"; public static final String STORAGE_TYPE = "storagetype"; +public static final String STORAGE_POLICY = "storagepolicy"; public static final String STORAGE_MOTION_ENABLED = "storagemotionenabled"; public static final String STORAGE_CAPABILITIES = "storagecapabilities"; public static final String SYSTEM_VM_TYPE = "systemvmtype"; diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java index b575fdb..d2ce43e 100644 --- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java +++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java @@ -18,23 +18,24 @@ */ package com.cloud.hypervisor.xenserver.resource; -import com.cloud.agent.api.Answer; -import com.cloud.agent.api.to.DataObjectType; -import com.cloud.agent.api.to.DataStoreTO; -import com.cloud.agent.api.to.DataTO; -import com.cloud.agent.api.to.DiskTO; -import com.cloud.agent.api.to.NfsTO; -import com.cloud.agent.api.to.S3TO; -import com.cloud.agent.api.to.SwiftTO; -import com.cloud.exception.InternalErrorException; -import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.SRType; -import com.cloud.storage.DataStoreRole; -import com.cloud.storage.Storage; -import com.cloud.storage.Storage.ImageFormat; -import com.cloud.storage.resource.StorageProcessor; -import com.cloud.utils.exception.CloudRuntimeException; -import com.cloud.utils.storage.S3.ClientOptions; +import static com.cloud.utils.ReflectUtil.flattenProperties; +import static com.google.common.collect.Lists.newArrayList; + +import java.io.File; +import java.net.URI; +import j
[cloudstack] branch 4.11 updated: ui: fix project network listing failure in UI (#2536)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 296a380 ui: fix project network listing failure in UI (#2536) 296a380 is described below commit 296a3804b9af2e5c3043e3266cb01bc39a6ad7ff Author: dahn AuthorDate: Fri Apr 27 12:54:37 2018 +0200 ui: fix project network listing failure in UI (#2536) Fixes #2533 --- ui/scripts/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index bcb748d..58fea81 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -732,9 +732,9 @@ gateway: args.data.guestGateway }); } -if (args.data.guestGateway != null && args.data.guestGateway.length > 0) { +if (args.data.guestNetmask != null && args.data.guestNetmask.length > 0) { $.extend(dataObj, { -gateway: args.data.guestGateway +netmask: args.data.guestNetmask }); } if (args.data.externalId != null && args.data.externalId.length > 0) { -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit e4537e9d39f72bb807f473fef42d9401145a60c8 Merge: d6cbd77 296a380 Author: Rohit Yadav AuthorDate: Fri Apr 27 12:57:51 2018 +0200 Merge branch '4.11' ui/scripts/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated (d6cbd77 -> e4537e9)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from d6cbd77 [CLOUDSTACK-10323] Allow changing disk offering during volume migration (#2486) add 296a380 ui: fix project network listing failure in UI (#2536) new e4537e9 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ui/scripts/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated: xenserver: Add support for XS 7.3, 7.4 and XCP-ng 7.4 (#2605)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.11 by this push: new 4645512 xenserver: Add support for XS 7.3, 7.4 and XCP-ng 7.4 (#2605) 4645512 is described below commit 464551208c879d64826d58d143d174876e4e11db Author: Rohit Yadav AuthorDate: Mon Apr 30 08:19:10 2018 +0200 xenserver: Add support for XS 7.3, 7.4 and XCP-ng 7.4 (#2605) This adds support for XenServer 7.3 and 7.4, and XCP-ng 7.4 version as hypervisor hosts. Fixes #2523. This also fixes the issue of 4.11 VRs stuck in starting for up-to 10mins, before they come up online. Signed-off-by: Rohit Yadav --- .../schema/resources/META-INF/db/schema-41100to41110.sql | 14 +- .../xenserver/discoverer/XcpServerDiscoverer.java | 2 +- .../hypervisor/xenserver/resource/CitrixResourceBase.java | 10 +++--- .../xenserver/resource/XenServerStorageProcessor.java | 3 ++- .../wrapper/xenbase/CitrixAttachIsoCommandWrapper.java | 2 +- .../resource/wrapper/xenbase/XenServerUtilitiesHelper.java | 5 + systemvm/debian/etc/systemd/system/cloud-postinit.service | 2 +- systemvm/debian/opt/cloud/bin/cs/CsApp.py | 2 +- systemvm/debian/opt/cloud/bin/cs/CsHelper.py | 5 +++-- 9 files changed, 34 insertions(+), 11 deletions(-) diff --git a/engine/schema/resources/META-INF/db/schema-41100to41110.sql b/engine/schema/resources/META-INF/db/schema-41100to41110.sql index 03e76c5..221a475 100644 --- a/engine/schema/resources/META-INF/db/schema-41100to41110.sql +++ b/engine/schema/resources/META-INF/db/schema-41100to41110.sql @@ -78,4 +78,16 @@ UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='5.1' AND hypervisor_type='VMware' AND guest_os_id='15'; UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='5.5' AND hypervisor_type='VMware' AND guest_os_id='15'; UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.0' AND hypervisor_type='VMware' AND guest_os_id='15'; -UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.5' AND hypervisor_type='VMware' AND guest_os_id='15'; \ No newline at end of file +UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.5' AND hypervisor_type='VMware' AND guest_os_id='15'; + +-- XenServer 7.3 +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.3.0', 500, 13, 1); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.3.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.2.0'; + +-- XenServer 7.4 +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.4.0', 500, 13, 1); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.4.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.3.0'; + +-- XCP-NG 7.4 +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', 'XCP-ng 7.4.0', 500, 13, 1); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', 'XCP-ng 7.4.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.4.0'; diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xenserver/sr
[cloudstack] branch master updated (586edec -> 4277b92)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 586edec CLOUDSTACK-10253: JSON response for SuccessResponse as boolean instead of string (#2428) add 4645512 xenserver: Add support for XS 7.3, 7.4 and XCP-ng 7.4 (#2605) new 4277b92 Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../src/main/resources/META-INF/db/schema-41100to41110.sql | 14 +- .../xenserver/discoverer/XcpServerDiscoverer.java | 2 +- .../hypervisor/xenserver/resource/CitrixResourceBase.java | 10 +++--- .../xenserver/resource/XenServerStorageProcessor.java | 3 ++- .../wrapper/xenbase/CitrixAttachIsoCommandWrapper.java | 2 +- .../resource/wrapper/xenbase/XenServerUtilitiesHelper.java | 5 + systemvm/debian/etc/systemd/system/cloud-postinit.service | 2 +- systemvm/debian/opt/cloud/bin/cs/CsApp.py | 2 +- systemvm/debian/opt/cloud/bin/cs/CsHelper.py | 5 +++-- 9 files changed, 34 insertions(+), 11 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated: CLOUDSTACK-10360: Change the method name. (#2598)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new 93509a4 CLOUDSTACK-10360: Change the method name. (#2598) 93509a4 is described below commit 93509a431cde8452037e79f7b85584a2a3c025df Author: Kui LIU AuthorDate: Mon Apr 30 09:24:47 2018 +0200 CLOUDSTACK-10360: Change the method name. (#2598) The method is named as "scoped" that seems to whether the variable config is scoped in _scopedStorages or not. Actually, the method tries to find a storage of which scope equals to the scope of config. So that, the method name "findStorage" should be more clear than "scoped". --- .../src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java | 2 +- .../org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java index 1734b98..2ace24d 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java @@ -152,7 +152,7 @@ public class ConfigKey { return value(); } -String value = s_depot != null ? s_depot.scoped(this).getConfigValue(id, this) : null; +String value = s_depot != null ? s_depot.findScopedConfigStorage(this).getConfigValue(id, this) : null; if (value == null) { return value(); } else { diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java index 6a85b90..bb49ce1 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java @@ -166,7 +166,7 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin { return _configDao; } -public ScopedConfigStorage scoped(ConfigKey config) { +public ScopedConfigStorage findScopedConfigStorage(ConfigKey config) { for (ScopedConfigStorage storage : _scopedStorages) { if (storage.getScope() == config.scope()) { return storage; -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated: CLOUDSTACK-10363: refactor the "getXXX" and "listXXX" method names to "findXXX" (#2599)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new 2c681b8 CLOUDSTACK-10363: refactor the "getXXX" and "listXXX" method names to "findXXX" (#2599) 2c681b8 is described below commit 2c681b8c5f253ae6e78314ac6f5bc3b1863bec4c Author: Kui LIU AuthorDate: Tue May 1 17:14:43 2018 +0200 CLOUDSTACK-10363: refactor the "getXXX" and "listXXX" method names to "findXXX" (#2599) These three methods are not direct getter or list. They try to find the target objects with the related arguments. So that, renaming them as "findXXX" should be more intuitive. --- .../cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java| 4 ++-- .../main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java | 10 +- .../java/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java| 2 +- .../com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java | 2 +- .../secondarystorage/PremiumSecondaryStorageManagerImpl.java | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index 3ce96a6..174f1f3 100644 --- a/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -482,7 +482,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, throw new CloudRuntimeException("Unable to find dispatcher name: " + dispatcherName); } -private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) { +private AsyncJobDispatcher findWakeupDispatcher(AsyncJob job) { if (_jobDispatchers != null) { List joinRecords = _joinMapDao.listJoinRecords(job.getId()); if (joinRecords.size() > 0) { @@ -567,7 +567,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, } if ((getAndResetPendingSignals(job) & AsyncJob.Constants.SIGNAL_MASK_WAKEUP) != 0) { -AsyncJobDispatcher jobDispatcher = getWakeupDispatcher(job); +AsyncJobDispatcher jobDispatcher = findWakeupDispatcher(job); if (jobDispatcher != null) { jobDispatcher.runJob(job); } else { diff --git a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java index cde4ee8..aa7c0f6 100644 --- a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java +++ b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java @@ -212,7 +212,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage Long from = r.getFrom(); Long to = r.getTo(); long networkId = r.getNetworkId(); -OvsTunnelNetworkVO tunnel = _tunnelNetworkDao.getByFromToNetwork(from, to, networkId); +OvsTunnelNetworkVO tunnel = _tunnelNetworkDao.findByFromToNetwork(from, to, networkId); if (tunnel == null) { throw new CloudRuntimeException( String.format("Unable find tunnelNetwork record" + @@ -321,7 +321,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage if (rh == hostId) { continue; } -OvsTunnelNetworkVO ta = _tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), nw.getId()); +OvsTunnelNetworkVO ta = _tunnelNetworkDao.findByFromToNetwork(hostId, rh.longValue(), nw.getId()); // Try and create the tunnel even if a previous attempt failed if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) { s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue()); @@ -333,7 +333,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage } } -ta = _tunnelNetworkDao.getByFromToNetwork(rh.longValue(), +ta = _tunnelNetworkDao.findByFromToNetwork(rh.longValue(), hostId, nw.getId()); // Try and create the tunnel even if a previous attempt failed if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) { @@ -605,7 +605,7 @
[cloudstack] branch master updated: CLOUDSTACK-10364: Change the "setXXX" method names to "generateXXX" (#2601)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new 503b2c6 CLOUDSTACK-10364: Change the "setXXX" method names to "generateXXX" (#2601) 503b2c6 is described below commit 503b2c649c342ab7c463eb02cb5513c818281c6c Author: Kui LIU AuthorDate: Tue May 1 17:17:54 2018 +0200 CLOUDSTACK-10364: Change the "setXXX" method names to "generateXXX" (#2601) The three methods are named as "setXXX", actually, they are not simple setter or getter. They are further renamed as "generateXXX" with dahn's comments. --- .../java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java | 8 .../main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java index 11b22c4..88e473d 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java @@ -298,11 +298,11 @@ public class BridgeVifDriver extends VifDriverBase { Script.runSimpleBashScript("test -d /sys/class/net/" + iface.getBrName() + "/brif/" + iface.getDevName() + " && brctl delif " + iface.getBrName() + " " + iface.getDevName()); } -private String setVnetBrName(String pifName, String vnetId) { +private String generateVnetBrName(String pifName, String vnetId) { return "br" + pifName + "-" + vnetId; } -private String setVxnetBrName(String pifName, String vnetId) { +private String generateVxnetBrName(String pifName, String vnetId) { return "brvx-" + vnetId; } @@ -317,9 +317,9 @@ public class BridgeVifDriver extends VifDriverBase { } String brName = ""; if (protocol.equals(Networks.BroadcastDomainType.Vxlan.scheme())) { -brName = setVxnetBrName(nic, vNetId); +brName = generateVxnetBrName(nic, vNetId); } else { -brName = setVnetBrName(nic, vNetId); +brName = generateVnetBrName(nic, vNetId); } createVnet(vNetId, nic, brName, protocol); return brName; diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java index 8e73d85..5f21b96 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java @@ -168,12 +168,12 @@ public class IvsVifDriver extends VifDriverBase { } } String brName = ""; -brName = setVnetBrName(nic, vNetId); +brName = generateVnetBrName(nic, vNetId); createVnet(vNetId, nic, brName, protocol); return brName; } -private String setVnetBrName(String pifName, String vnetId) { +private String generateVnetBrName(String pifName, String vnetId) { return "br" + pifName + "-" + vnetId; } -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.9 updated: CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.9 in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/4.9 by this push: new df2b26e CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471) df2b26e is described below commit df2b26e350121834435d1f4b888a8ecd00c0b5db Author: Slair1 AuthorDate: Wed May 2 02:45:48 2018 -0500 CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471) * CLOUDSTACK-10311 Agent Log Rotate variable replace bug * update travis timeouts --- .travis.yml | 4 ++-- .../{cloudstack-agent.logrotate => cloudstack-agent.logrotate.in} | 0 agent/pom.xml | 6 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f975c55..359d666 100644 --- a/.travis.yml +++ b/.travis.yml @@ -149,9 +149,9 @@ env: #- TESTS="component/test_accounts" #- TESTS="component/test_organization_states" -before_install: travis_wait 30 ./tools/travis/before_install.sh +before_install: travis_wait 60 ./tools/travis/before_install.sh install: ./tools/travis/install.sh -before_script: travis_wait 30 ./tools/travis/before_script.sh +before_script: travis_wait 60 ./tools/travis/before_script.sh script: - travis_wait 40 ./tools/travis/script.sh ${TESTS} after_success: ./tools/travis/after_success.sh diff --git a/agent/conf/cloudstack-agent.logrotate b/agent/conf/cloudstack-agent.logrotate.in similarity index 100% rename from agent/conf/cloudstack-agent.logrotate rename to agent/conf/cloudstack-agent.logrotate.in diff --git a/agent/pom.xml b/agent/pom.xml index 2eb6ca9..02eb9d8 100644 --- a/agent/pom.xml +++ b/agent/pom.xml @@ -93,12 +93,6 @@ - - - - - -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.9' into 4.10
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.10 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit b923c22dd41dead2f3be9b85cf2dfaeb1915be90 Merge: 5dcc3c2 df2b26e Author: Rohit Yadav AuthorDate: Wed May 2 13:16:46 2018 +0530 Merge branch '4.9' into 4.10 .travis.yml | 4 ++-- .../{cloudstack-agent.logrotate => cloudstack-agent.logrotate.in} | 0 agent/pom.xml | 6 -- 3 files changed, 2 insertions(+), 8 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.11 updated (4645512 -> 314caff)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 4645512 xenserver: Add support for XS 7.3, 7.4 and XCP-ng 7.4 (#2605) add df2b26e CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471) add b923c22 Merge branch '4.9' into 4.10 new 314caff Merge branch '4.10' into 4.11 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch 4.10 updated (5dcc3c2 -> b923c22)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch 4.10 in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 5dcc3c2 Merge branch '4.9' into 4.10 add df2b26e CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471) new b923c22 Merge branch '4.9' into 4.10 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml | 4 ++-- .../{cloudstack-agent.logrotate => cloudstack-agent.logrotate.in} | 0 agent/pom.xml | 6 -- 3 files changed, 2 insertions(+), 8 deletions(-) rename agent/conf/{cloudstack-agent.logrotate => cloudstack-agent.logrotate.in} (100%) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated (c6b4467 -> 5df580e)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from c6b4467 When creating a new account (via domain admin) it is possible to select “root admin” as the role for the new user (#2606) add df2b26e CLOUDSTACK-10311 Agent Log Rotate variable replace bug (#2471) add b923c22 Merge branch '4.9' into 4.10 add 314caff Merge branch '4.10' into 4.11 new 5df580e Merge branch '4.11' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.10' into 4.11
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 314caffcd795b20534cff5204df55b68fccf240f Merge: 4645512 b923c22 Author: Rohit Yadav AuthorDate: Wed May 2 13:17:18 2018 +0530 Merge branch '4.10' into 4.11 Signed-off-by: Rohit Yadav -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/01: Merge branch '4.11'
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 5df580ef64a0dca92012dd7d1f68ab413e5f66ac Merge: c6b4467 314caff Author: Rohit Yadav AuthorDate: Wed May 2 13:18:29 2018 +0530 Merge branch '4.11' -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-rn] branch 4.11 updated: update rn-docs for 4.11.1.0 systemvmtemplate configuration and url
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-rn.git The following commit(s) were added to refs/heads/4.11 by this push: new b96d833 update rn-docs for 4.11.1.0 systemvmtemplate configuration and url b96d833 is described below commit b96d833c5790b4fb457b91b7908eaeaea3ef2627 Author: Rohit Yadav AuthorDate: Wed May 2 19:30:06 2018 +0530 update rn-docs for 4.11.1.0 systemvmtemplate configuration and url Signed-off-by: Rohit Yadav --- source/about.rst| 9 +- source/conf.py | 2 +- source/global.rst | 10 +- source/index.rst| 1 + source/upgrade/_sysvm_templates.rst | 20 +- source/upgrade/upgrade-4.11.rst | 419 6 files changed, 440 insertions(+), 21 deletions(-) diff --git a/source/about.rst b/source/about.rst index 0b59de7..e496b89 100644 --- a/source/about.rst +++ b/source/about.rst @@ -12,7 +12,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - + What's New in |version| === @@ -24,7 +24,8 @@ releases that was worked on for 8 months. A LOT changed in this release, so this is not a complete list, but here is a quick summary of some of the changes: -* Support for XenServer 7.1 and 7.2, and improved support for VMware 6.5. +* Support for XenServer 7.1, 7.2, 7.3 and 7.4, and support for XCP-ng 7.4. +* Improved support for VMware 6.5. * Host-HA framework and HA-provider for KVM hosts with and NFS as primary storage, and a new background polling task manager. * Secure agents communication: new certificate authority framework and a default built-in root CA provider. * New network type - L2. @@ -62,8 +63,8 @@ quick summary of some of the changes: * Improved support for Java 8 for building artifacts/modules, packaging, and in the systemvm template. * A faster console proxy startup and service availability. -* A new Debian 9 based systemvm template that patches systemvm without requiring - reboot. +* A new Debian 9 based smaller systemvm template that patches systemvm without + requiring reboot. * Several optimizations and improvements to the virtual router including better support for redundant virtual routers and strongswan provided s2s and remote access vpn. diff --git a/source/conf.py b/source/conf.py index 1065f60..b09a0d9 100644 --- a/source/conf.py +++ b/source/conf.py @@ -76,7 +76,7 @@ copyright = u'2018, Apache CloudStack' # The short X.Y version. version = '4.11' # The full version, including alpha/beta/rc tags. -release = '4.11.0.0' +release = '4.11.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/source/global.rst b/source/global.rst index 55a36ad..c37e617 100644 --- a/source/global.rst +++ b/source/global.rst @@ -21,11 +21,11 @@ .. _CloudStack Apidocs: http://cloudstack.apache.org/docs/api/ .. Latest version systemvm template URL -.. |sysvm64-url-xen|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-xen.vhd.bz2 -.. |sysvm64-url-kvm|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2 -.. |sysvm64-url-vmware| replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-vmware.ova -.. |sysvm64-url-hyperv| replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-hyperv.vhd.zip -.. |sysvm64-url-ovm|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-ovm.raw.bz2 +.. |sysvm64-url-xen|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-xen.vhd.bz2 +.. |sysvm64-url-kvm|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-kvm.qcow2.bz2 +.. |sysvm64-url-vmware| replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-vmware.ova +.. |sysvm64-url-hyperv| replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-hyperv.vhd.zip +.. |sysvm64-url-ovm|replace:: http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-ovm.raw.bz2 .. Version specific: 4.5 systemvm template URL .. |acs45-sysvm64-url-xen|replace:: http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-xen.vhd.bz2 diff --git a/source/index.rst b/source/index.rst index ef487a9..0da55a2 100644 --- a/source/index.rst +++ b/source/index.rst @@ -67,6 +67,7 @@ Contents: .. toctree:: :maxdepth: 1 + upgrade/upgrade-4.11 upgrade/upgrade-4.10 upgrade/upgrade-4.9 upgrade/upgrade-4.8 diff --git a/source/upgrade/_sysvm_templates.rst b/source/upgrade/_sysvm_templates.rst index f279165..45bee8c 100
[cloudstack-docs-rn] 01/01: conf: bump master version to 4.12.0.0
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-rn.git commit 4378e5c6bc6c829df02cba154546cfb4e431d449 Author: Rohit Yadav AuthorDate: Wed May 2 19:31:06 2018 +0530 conf: bump master version to 4.12.0.0 Signed-off-by: Rohit Yadav --- source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/conf.py b/source/conf.py index b09a0d9..bd2b8eb 100644 --- a/source/conf.py +++ b/source/conf.py @@ -74,9 +74,9 @@ copyright = u'2018, Apache CloudStack' # built documents. # # The short X.Y version. -version = '4.11' +version = '4.12' # The full version, including alpha/beta/rc tags. -release = '4.11.1.0' +release = '4.12.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack-docs-rn] branch master updated (4bef109 -> 4378e5c)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-docs-rn.git. from 4bef109 Add upgrade remark for 4.10.0.0 users. add b96d833 update rn-docs for 4.11.1.0 systemvmtemplate configuration and url new 4378e5c conf: bump master version to 4.12.0.0 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: source/about.rst | 9 + source/conf.py | 4 ++-- source/global.rst| 10 +- source/index.rst | 1 + source/upgrade/_sysvm_templates.rst | 20 +--- .../upgrade/{upgrade-4.10.rst => upgrade-4.11.rst} | 11 +++ 6 files changed, 25 insertions(+), 30 deletions(-) copy source/upgrade/{upgrade-4.10.rst => upgrade-4.11.rst} (97%) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] branch master updated: api: Fixes #2528 move ostypeid from id to uuid (#2608)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new d94a5be api: Fixes #2528 move ostypeid from id to uuid (#2608) d94a5be is described below commit d94a5bea3c3f826fc53d8a555bd69714546e025d Author: Marc-Aurèle Brothier AuthorDate: Thu May 3 13:00:26 2018 +0200 api: Fixes #2528 move ostypeid from id to uuid (#2608) This moves the ostypeid in api response to uuid instead of integer id. --- .../java/org/apache/cloudstack/api/response/UserVmResponse.java | 6 +++--- server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java index 2ff1eaa..8db4f85 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java @@ -284,7 +284,7 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co @SerializedName(ApiConstants.OS_TYPE_ID) @Param(description = "OS type id of the vm", since = "4.4") -private Long osTypeId; +private String osTypeId; public UserVmResponse() { securityGroupList = new LinkedHashSet(); @@ -810,7 +810,7 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co this.details = details; } -public void setOsTypeId(Long osTypeId) { +public void setOsTypeId(String osTypeId) { this.osTypeId = osTypeId; } @@ -834,7 +834,7 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co isDynamicallyScalable = dynamicallyScalable; } -public Long getOsTypeId() { +public String getOsTypeId() { return osTypeId; } } diff --git a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index f0a0a56..00ec61a 100644 --- a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -196,7 +196,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation
[cloudstack] branch master updated: CLOUDSTACK-9781: record resource uuid in events instead of integer id (#1940)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new 1ff171d CLOUDSTACK-9781: record resource uuid in events instead of integer id (#1940) 1ff171d is described below commit 1ff171db902b98df5d172ae468c33a07ea1204d5 Author: jayantpatil1234 AuthorDate: Thu May 3 16:32:00 2018 +0530 CLOUDSTACK-9781: record resource uuid in events instead of integer id (#1940) This changes several event logging to use uuid of resource than integer id when creating API events. --- .../admin/router/CreateVirtualRouterElementCmd.java | 4 ++-- .../api/command/admin/router/DestroyRouterCmd.java | 4 ++-- .../api/command/admin/router/RebootRouterCmd.java| 4 ++-- .../api/command/admin/router/StartRouterCmd.java | 4 ++-- .../api/command/admin/router/StopRouterCmd.java | 4 ++-- .../command/admin/systemvm/DestroySystemVmCmd.java | 4 ++-- .../command/admin/systemvm/MigrateSystemVMCmd.java | 4 ++-- .../command/admin/systemvm/RebootSystemVmCmd.java| 4 ++-- .../api/command/admin/systemvm/ScaleSystemVMCmd.java | 4 ++-- .../api/command/admin/systemvm/StartSystemVMCmd.java | 4 ++-- .../api/command/admin/systemvm/StopSystemVmCmd.java | 4 ++-- .../command/admin/systemvm/UpgradeSystemVMCmd.java | 2 +- .../admin/template/CreateTemplateCmdByAdmin.java | 4 +++- .../api/command/admin/vm/AddNicToVMCmdByAdmin.java | 3 ++- .../api/command/admin/vm/DeployVMCmdByAdmin.java | 2 +- .../api/command/admin/vm/DestroyVMCmdByAdmin.java| 2 +- .../api/command/admin/vm/ExpungeVMCmd.java | 4 ++-- .../api/command/admin/vm/MigrateVMCmd.java | 12 +--- .../admin/vm/MigrateVirtualMachineWithVolumeCmd.java | 2 +- .../api/command/admin/vm/RebootVMCmdByAdmin.java | 2 +- .../command/admin/vm/RemoveNicFromVMCmdByAdmin.java | 3 ++- .../api/command/admin/vm/RestoreVMCmdByAdmin.java| 2 +- .../api/command/admin/vm/StartVMCmdByAdmin.java | 2 +- .../api/command/admin/vm/StopVMCmdByAdmin.java | 2 +- .../admin/vm/UpdateDefaultNicForVMCmdByAdmin.java| 3 ++- .../api/command/admin/vm/UpdateVMCmdByAdmin.java | 2 +- .../api/command/admin/vm/UpgradeVMCmdByAdmin.java| 2 +- .../vmsnapshot/RevertToVMSnapshotCmdByAdmin.java | 3 ++- .../command/admin/volume/AttachVolumeCmdByAdmin.java | 2 +- .../command/admin/volume/CreateVolumeCmdByAdmin.java | 2 +- .../command/admin/volume/DetachVolumeCmdByAdmin.java | 2 +- .../command/admin/volume/ResizeVolumeCmdByAdmin.java | 2 +- .../command/admin/volume/UpdateVolumeCmdByAdmin.java | 2 +- .../api/command/user/snapshot/CreateSnapshotCmd.java | 10 +- .../snapshot/CreateSnapshotFromVMSnapshotCmd.java| 4 ++-- .../api/command/user/snapshot/DeleteSnapshotCmd.java | 4 ++-- .../api/command/user/snapshot/RevertSnapshotCmd.java | 4 ++-- .../api/command/user/template/CopyTemplateCmd.java | 20 ++-- .../api/command/user/template/CreateTemplateCmd.java | 2 +- .../api/command/user/template/DeleteTemplateCmd.java | 4 ++-- .../command/user/template/ExtractTemplateCmd.java| 3 ++- .../api/command/user/vm/AddIpToVmNicCmd.java | 6 +++--- .../api/command/user/vm/AddNicToVMCmd.java | 5 +++-- .../cloudstack/api/command/user/vm/DeployVMCmd.java | 4 ++-- .../cloudstack/api/command/user/vm/DestroyVMCmd.java | 4 ++-- .../cloudstack/api/command/user/vm/RebootVMCmd.java | 4 ++-- .../api/command/user/vm/RemoveNicFromVMCmd.java | 5 +++-- .../cloudstack/api/command/user/vm/RestoreVMCmd.java | 2 +- .../cloudstack/api/command/user/vm/ScaleVMCmd.java | 5 +++-- .../cloudstack/api/command/user/vm/StartVMCmd.java | 4 ++-- .../cloudstack/api/command/user/vm/StopVMCmd.java| 4 ++-- .../command/user/vm/UpdateDefaultNicForVMCmd.java| 5 +++-- .../cloudstack/api/command/user/vm/UpdateVMCmd.java | 2 +- .../api/command/user/vm/UpdateVmNicIpCmd.java| 2 +- .../cloudstack/api/command/user/vm/UpgradeVMCmd.java | 2 +- .../command/user/vmsnapshot/CreateVMSnapshotCmd.java | 5 +++-- .../command/user/vmsnapshot/DeleteVMSnapshotCmd.java | 4 ++-- .../user/vmsnapshot/RevertToVMSnapshotCmd.java | 4 ++-- .../api/command/user/volume/AttachVolumeCmd.java | 4 ++-- .../api/command/user/volume/CreateVolumeCmd.java | 4 ++-- .../api/command/user/volume/DeleteVolumeCmd.java | 2 +- .../api/command/user/volume/DetachVolumeCmd.java | 6 +++--- .../api/command/user/volume/ExtractVolumeCmd.java| 2 +- .../api/command/user/volume/MigrateVolumeCmd.java| 3 ++- .../api/command/user/volume/ResizeVolumeCmd.java | 4 ++-- .../api/command/user/volume/UpdateVolumeCmd.java | 2 +- .../api/command/user/volume/UploadVolumeCmd.java | 3 ++- .../java/com/cloud/storage
[cloudstack] 07/08: test/integration: fix invalid VMware smoketests failures
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 85ad4639b05ee41b25c154f4ad4650795eca26b9 Author: Rohit Yadav AuthorDate: Wed May 2 15:55:14 2018 +0530 test/integration: fix invalid VMware smoketests failures Signed-off-by: Rohit Yadav --- test/integration/smoke/test_service_offerings.py | 3 +-- test/integration/smoke/test_vm_life_cycle.py | 10 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index 2788d0e..9d05a7a 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -448,7 +448,7 @@ class TestCpuCapServiceOfferings(cloudstackTestCase): cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() cls.hypervisor = testClient.getHypervisorInfo() - +cls._cleanup = [] cls.hypervisorNotSupported = False if cls.hypervisor.lower() not in ["kvm"]: cls.hypervisorNotSupported = True @@ -516,7 +516,6 @@ class TestCpuCapServiceOfferings(cloudstackTestCase): cls.offering, cls.account ] -return @classmethod def tearDownClass(cls): diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index d882c1f..a2daee8 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -794,6 +794,10 @@ class TestSecuredVmMigration(cloudstackTestCase): cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() cls.hypervisor = testClient.getHypervisorInfo() +cls._cleanup = [] + +if cls.hypervisor.lower() not in ["kvm"]: +return # Get Zone, Domain and templates domain = get_domain(cls.apiclient) @@ -846,12 +850,12 @@ class TestSecuredVmMigration(cloudstackTestCase): self.apiclient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() self.cleanup = [] -self.updateConfiguration("ca.plugin.root.auth.strictness", "false") -self.make_all_hosts_secure() - if self.hypervisor.lower() not in ["kvm"]: self.skipTest("Secured migration is not supported on other than KVM") +self.updateConfiguration("ca.plugin.root.auth.strictness", "false") +self.make_all_hosts_secure() + def tearDown(self): self.make_all_hosts_secure() -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 03/08: systemvmtemplate: Fixes #2541 adds Letsencrypt CA cert
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit ddc8d131c080c363d82eadd75c811faaad81e9f9 Author: Rohit Yadav AuthorDate: Tue May 1 15:01:11 2018 +0530 systemvmtemplate: Fixes #2541 adds Letsencrypt CA cert On patching, the global cacerts keystore is imported in 'cloud' service specific local keystore. This fixes #2541. Signed-off-by: Rohit Yadav --- systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh| 2 ++ .../systemvmtemplate/scripts/configure_systemvm_services.sh | 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh b/systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh index ba5e2d8..c0d6d81 100755 --- a/systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh +++ b/systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh @@ -37,6 +37,8 @@ patch_systemvm() { echo "Restored keystore file and certs using backup" >> $logfile fi rm -fr $backupfolder + # Import global cacerts into 'cloud' service's keystore + keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /usr/local/cloud/systemvm/certs/realhostip.keystore -srcstorepass changeit -deststorepass vmops.com -noprompt || true return 0 } diff --git a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh index 3544806..7af9212 100644 --- a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh +++ b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh @@ -19,7 +19,7 @@ set -e set -x -CLOUDSTACK_RELEASE=4.11.0 +CLOUDSTACK_RELEASE=4.11.1 function configure_apache2() { # Enable ssl, rewrite and auth @@ -31,6 +31,16 @@ function configure_apache2() { sed -i 's/SSLProtocol .*$/SSLProtocol TLSv1.2/g' /etc/apache2/mods-available/ssl.conf } +function configure_cacerts() { + CDIR=$(pwd) + cd /tmp + # Add LetsEncrypt ca-cert + wget https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der + keytool -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -importcert -alias letsencryptauthorityx3cross -file lets-encrypt-x3-cross-signed.der + rm -f lets-encrypt-x3-cross-signed.der + cd $CDIR +} + function install_cloud_scripts() { # ./cloud_scripts/ has been put there by ../../cloud_scripts_shar_archive.sh rsync -av ./cloud_scripts/ / @@ -102,6 +112,7 @@ function configure_services() { configure_apache2 configure_strongswan configure_issue + configure_cacerts } return 2>/dev/null || configure_services -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 01/08: solidfire: fix potential NPE
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 2be45c218650c8bb7159f8d846d4e59768aeb357 Author: Rohit Yadav AuthorDate: Mon Apr 30 17:35:01 2018 +0530 solidfire: fix potential NPE Signed-off-by: Rohit Yadav --- .../cloudstack/storage/datastore/provider/SolidFireHostListener.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java index f9c27e9..f2a4b79 100644 --- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java +++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java @@ -152,7 +152,7 @@ public class SolidFireHostListener implements HypervisorHostListener { } private void handleVMware(HostVO host, boolean add, ModifyTargetsCommand.TargetTypeToRemove targetTypeToRemove) { -if (HypervisorType.VMware.equals(host.getHypervisorType())) { +if (host != null && HypervisorType.VMware.equals(host.getHypervisorType())) { List storagePools = _storagePoolDao.findPoolsByProvider(SolidFireUtil.PROVIDER_NAME); if (storagePools != null && storagePools.size() > 0) { -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 04/08: systemvm: Fixes #2561 patching on XenServer
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 8533def696dacb989b8fde17403bfca98e6139b0 Author: Rohit Yadav AuthorDate: Wed May 2 14:57:10 2018 +0530 systemvm: Fixes #2561 patching on XenServer This fixes incorrect xenstore-read binary path, this failed systemvm to be patched/started correctly on xenserver. The other fix is to keep the xen-domU flag that may be returned by virt-what. This effect won't change the cmdline being consumed as the mgmt server side (java) code sets the boot args in both xenstore and as pv args. The systemvm's /boot is ext2 that can be booted by PyGrub on both old and recent XenServer versions. Signed-off-by: Rohit Yadav --- systemvm/debian/opt/cloud/bin/setup/cloud-early-config| 8 .../systemvmtemplate/scripts/install_systemvm_packages.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config index a9ad094..9baed01 100755 --- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config +++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config @@ -71,16 +71,16 @@ config_guest() { get_boot_params() { case $HYPERVISOR in - xen-pv) + xen-pv|xen-domU) cat /proc/cmdline > $CMDLINE sed -i "s/%/ /g" $CMDLINE ;; xen-hvm) - if [ ! -f /usr/sbin/xenstore-read ]; then + if [ ! -f /usr/bin/xenstore-read ]; then log_it "ERROR: xentools not installed, cannot found xenstore-read" && exit 5 fi - /usr/sbin/xenstore-read vm-data/cloudstack/init > /var/cache/cloud/cmdline - sed -i "s/%/ /g" /var/cache/cloud/cmdline + /usr/bin/xenstore-read vm-data/cloudstack/init > $CMDLINE + sed -i "s/%/ /g" $CMDLINE ;; kvm) VPORT=$(find /dev/virtio-ports -type l -name '*.vport' 2>/dev/null|head -1) diff --git a/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh b/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh index a5b1379..c1c3e94 100644 --- a/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh +++ b/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh @@ -86,9 +86,9 @@ function install_packages() { fi # Install xenserver guest utilities as debian repos don't have it - wget https://mirrors.kernel.org/ubuntu/pool/universe/x/xe-guest-utilities/xe-guest-utilities_7.4.0-0ubuntu1_amd64.deb - dpkg -i xe-guest-utilities_7.4.0-0ubuntu1_amd64.deb - rm -f xe-guest-utilities_7.4.0-0ubuntu1_amd64.deb + wget https://mirrors.kernel.org/ubuntu/pool/main/x/xe-guest-utilities/xe-guest-utilities_7.10.0-0ubuntu1_amd64.deb + dpkg -i xe-guest-utilities_7.10.0-0ubuntu1_amd64.deb + rm -f xe-guest-utilities_7.10.0-0ubuntu1_amd64.deb } return 2>/dev/null || install_packages -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 06/08: vr: create tables before applying egress iptables rules
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 77172b9f032f8df0564e33026178acd579c23cd4 Author: Rohit Yadav AuthorDate: Tue May 1 20:06:12 2018 +0530 vr: create tables before applying egress iptables rules This fixes the issue that post-upgrade egress rules are not applied on VR, restarting the network with cleanup used to be the workaround. Signed-off-by: Rohit Yadav --- systemvm/debian/opt/cloud/bin/configure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/systemvm/debian/opt/cloud/bin/configure.py b/systemvm/debian/opt/cloud/bin/configure.py index f9247ad..e023a9f 100755 --- a/systemvm/debian/opt/cloud/bin/configure.py +++ b/systemvm/debian/opt/cloud/bin/configure.py @@ -957,6 +957,7 @@ class IpTablesExecutor: acls.process() acls = CsAcl('firewallrules', self.config) +acls.flushAllowAllEgressRules() acls.process() fwd = CsForwardingRules("forwardingrules", self.config) -- To stop receiving notification emails like this one, please contact ro...@apache.org.
[cloudstack] 08/08: engine/schema: new 4.11.1 systemvmtemplate
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 05857c717d8bc0bb151f6a7d231d6862c6ebf483 Author: Rohit Yadav AuthorDate: Tue May 1 16:55:40 2018 +0530 engine/schema: new 4.11.1 systemvmtemplate This moves db upgrade paths and checks around a new systemvmtemplate for 4.11.1. The new systemvmtemplate compared to 4.11.0 template is slightly smaller and has meltdown/spectre fixes among few other security fixes from Debian and changes to cloud-early-config. Signed-off-by: Rohit Yadav --- .../com/cloud/upgrade/dao/Upgrade41000to41100.java | 175 .../com/cloud/upgrade/dao/Upgrade41100to41110.java | 184 - 2 files changed, 182 insertions(+), 177 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java index 20294d1..3900cf0 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java @@ -22,15 +22,11 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; -import com.cloud.hypervisor.Hypervisor; import com.cloud.utils.PropertiesUtil; import com.cloud.utils.exception.CloudRuntimeException; @@ -68,7 +64,6 @@ public class Upgrade41000to41100 implements DbUpgrade { public void performDataMigration(Connection conn) { checkAndEnableDynamicRoles(conn); validateUserDataInBase64(conn); -updateSystemVmTemplates(conn); } private void checkAndEnableDynamicRoles(final Connection conn) { @@ -126,176 +121,6 @@ public class Upgrade41000to41100 implements DbUpgrade { } } -@SuppressWarnings("serial") -private void updateSystemVmTemplates(final Connection conn) { -LOG.debug("Updating System Vm template IDs"); -// Get all hypervisors in use -final Set hypervisorsListInUse = new HashSet(); -try (PreparedStatement pstmt = conn.prepareStatement("select distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); ResultSet rs = pstmt.executeQuery()) { -while (rs.next()) { -switch (Hypervisor.HypervisorType.getType(rs.getString(1))) { -case XenServer: - hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer); -break; -case KVM: - hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM); -break; -case VMware: - hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware); -break; -case Hyperv: - hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv); -break; -case LXC: - hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC); -break; -case Ovm3: - hypervisorsListInUse.add(Hypervisor.HypervisorType.Ovm3); -break; -default: -break; -} -} -} catch (final SQLException e) { -LOG.error("updateSystemVmTemplates: Exception caught while getting hypervisor types from clusters: " + e.getMessage()); -throw new CloudRuntimeException("updateSystemVmTemplates:Exception while getting hypervisor types from clusters", e); -} - -final Map NewTemplateNameList = new HashMap() { -{ -put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.11"); -put(Hypervisor.HypervisorType.VMware, "systemvm-vmware-4.11"); -put(Hypervisor.HypervisorType.XenServer, "systemvm-xenserver-4.11"); -put(Hypervisor.HypervisorType.Hyperv, "systemvm-hyperv-4.11"); -put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.11"); -put(Hypervisor.HypervisorType.Ovm3, "systemvm-ovm3-4.11"); -} -}; - -final Map routerTemplateConfigurationNames = new HashMap() { -{ -put(Hypervisor.HypervisorType.KVM, "router.template.kvm"); -put(Hypervisor.HypervisorType.VMware, "router.template.vmware"); -put(Hypervisor.HypervisorType.XenServer, "router.template.xenserver&q
[cloudstack] 02/08: ca: Fixes #2530 have all IPs from KVM host in issued X509 cert
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit eb75c1eff51e4e121f7ef690cb56b8b22d43f143 Author: Rohit Yadav AuthorDate: Mon Apr 30 17:40:20 2018 +0530 ca: Fixes #2530 have all IPs from KVM host in issued X509 cert This ensures that certificate setup includes all the IP addresses (v4 and v6) when a (KVM) host is added to CloudStack. This fixes #2530. Signed-off-by: Rohit Yadav --- .../cloudstack/ca/provider/RootCAProvider.java | 49 +++--- scripts/util/keystore-setup| 3 +- .../cloudstack/utils/security/CertUtils.java | 5 ++- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java index 6584b35..f36d067 100644 --- a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java +++ b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java @@ -20,6 +20,7 @@ package org.apache.cloudstack.ca.provider; import java.io.IOException; import java.io.StringReader; import java.math.BigInteger; +import java.net.InetAddress; import java.security.InvalidKeyException; import java.security.KeyManagementException; import java.security.KeyPair; @@ -34,6 +35,7 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.security.spec.InvalidKeySpecException; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -45,6 +47,7 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; +import javax.xml.bind.DatatypeConverter; import org.apache.cloudstack.ca.CAManager; import org.apache.cloudstack.framework.ca.CAProvider; @@ -55,9 +58,15 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.utils.security.CertUtils; import org.apache.cloudstack.utils.security.KeyStoreUtils; import org.apache.log4j.Logger; -import org.bouncycastle.jce.PKCS10CertificationRequest; +import org.bouncycastle.asn1.pkcs.Attribute; +import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; +import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.asn1.x509.Extensions; +import org.bouncycastle.asn1.x509.GeneralName; +import org.bouncycastle.asn1.x509.GeneralNames; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.OperatorCreationException; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemReader; @@ -137,7 +146,17 @@ public final class RootCAProvider extends AdapterBase implements CAProvider, Con return new Certificate(clientCertificate, keyPair.getPrivate(), Collections.singletonList(caCertificate)); } -private Certificate generateCertificateUsingCsr(final String csr, final List domainNames, final List ipAddresses, final int validityDays) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, CertificateException, SignatureException, IOException, OperatorCreationException { +private Certificate generateCertificateUsingCsr(final String csr, final List names, final List ips, final int validityDays) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, CertificateException, SignatureException, IOException, OperatorCreationException { +final List dnsNames = new ArrayList<>(); +final List ipAddresses = new ArrayList<>(); + +if (names != null) { +dnsNames.addAll(names); +} +if (ips != null) { +ipAddresses.addAll(ips); +} + PemObject pemObject = null; try { @@ -151,13 +170,33 @@ public final class RootCAProvider extends AdapterBase implements CAProvider, Con throw new CloudRuntimeException("Unable to read/process CSR: " + csr); } -final PKCS10CertificationRequest request = new PKCS10CertificationRequest(pemObject.getContent()); +final JcaPKCS10CertificationRequest request = new JcaPKCS10CertificationRequest(pemObject.getContent()); +final String subject = request.getSubject().toString(); +for (final Attribute attribute : request.getAttributes()) { +if (attribute == null) { +continue; +} +if (attribute.getAttrType().equals(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest)) { +final Extensions extensions = Extensions.getInstance(attribute.getAttrValues().getObjectAt(0));
[cloudstack] branch 4.11 updated (314caff -> 05857c7)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git. from 314caff Merge branch '4.10' into 4.11 new 2be45c2 solidfire: fix potential NPE new eb75c1e ca: Fixes #2530 have all IPs from KVM host in issued X509 cert new ddc8d13 systemvmtemplate: Fixes #2541 adds Letsencrypt CA cert new 8533def systemvm: Fixes #2561 patching on XenServer new 6412e50 saml2: Fixes #2548 SAML2 cert encoding and decoding new 77172b9 vr: create tables before applying egress iptables rules new 85ad463 test/integration: fix invalid VMware smoketests failures new 05857c7 engine/schema: new 4.11.1 systemvmtemplate The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../com/cloud/upgrade/dao/Upgrade41000to41100.java | 175 .../com/cloud/upgrade/dao/Upgrade41100to41110.java | 184 - .../cloudstack/ca/provider/RootCAProvider.java | 49 +- .../datastore/provider/SolidFireHostListener.java | 2 +- .../cloudstack/saml/SAML2AuthManagerImpl.java | 22 +-- .../src/org/apache/cloudstack/saml/SAMLUtils.java | 89 +- .../test/org/apache/cloudstack/SAMLUtilsTest.java | 10 +- scripts/util/keystore-setup| 3 +- systemvm/debian/opt/cloud/bin/configure.py | 1 + .../debian/opt/cloud/bin/setup/cloud-early-config | 8 +- .../debian/opt/cloud/bin/setup/patchsystemvm.sh| 2 + test/integration/smoke/test_service_offerings.py | 3 +- test/integration/smoke/test_vm_life_cycle.py | 10 +- .../scripts/configure_systemvm_services.sh | 13 +- .../scripts/install_systemvm_packages.sh | 6 +- ui/index.html | 1 - .../cloudstack/utils/security/CertUtils.java | 5 +- 17 files changed, 356 insertions(+), 227 deletions(-) -- To stop receiving notification emails like this one, please contact ro...@apache.org.