[cloudstack] branch master updated: utils: cleanup Macaddresses utils (#2660)

2018-11-29 Thread rohit
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 9a4149e  utils: cleanup Macaddresses utils (#2660)
9a4149e is described below

commit 9a4149e5dcbfe00dc26ff84eeea70eca94f97daf
Author: dahn 
AuthorDate: Thu Nov 29 17:53:50 2018 +0100

utils: cleanup Macaddresses utils (#2660)

Cleanup parse code, fix java docs and remove unwanted comments.
---
 .../main/java/com/cloud/utils/net/MacAddress.java  | 90 ++
 .../java/com/cloud/utils/net/MacAddressTest.java   |  6 --
 2 files changed, 5 insertions(+), 91 deletions(-)

diff --git a/utils/src/main/java/com/cloud/utils/net/MacAddress.java 
b/utils/src/main/java/com/cloud/utils/net/MacAddress.java
index b9118cf..d7ac9e3 100644
--- a/utils/src/main/java/com/cloud/utils/net/MacAddress.java
+++ b/utils/src/main/java/com/cloud/utils/net/MacAddress.java
@@ -31,12 +31,10 @@ import java.util.Formatter;
 
 import org.apache.log4j.Logger;
 
-import com.cloud.utils.NumbersUtil;
-
 /**
- * copied from the public domain utility from John Burkard.
- * @author mailto:j...@eaio.com";>Johann Burkard
- * @version 2.1.3
+ * This class retrieves the (first) MAC address for the machine is it is 
loaded on and stores it statically for retrieval.
+ * It can also be used for formatting MAC addresses.
+ * copied fnd addpeted rom the public domain utility from John Burkard.
  **/
 public class MacAddress {
 private static final Logger s_logger = Logger.getLogger(MacAddress.class);
@@ -70,19 +68,6 @@ public class MacAddress {
 formatter.format("%02x%s%02x%s%02x%s%02x%s%02x%s%02x", _addr >> 40 & 
0xff, separator, _addr >> 32 & 0xff, separator, _addr >> 24 & 0xff, separator,
 _addr >> 16 & 0xff, separator, _addr >> 8 & 0xff, separator, _addr 
& 0xff);
 return buff.toString();
-
-/*
-
-String str = Long.toHexString(_addr);
-
-for (int i = str.length() - 1; i >= 0; i--) {
-buff.append(str.charAt(i));
-if (separator != null && (str.length() - i) % 2 == 0) {
-buff.append(separator);
-}
-}
-return buff.reverse().toString();
- */
 }
 
 @Override
@@ -242,13 +227,6 @@ public class MacAddress {
 return null;
 }
 
-public static void main(String[] args) {
-MacAddress addr = MacAddress.getMacAddress();
-System.out.println("addr in integer is " + addr.toLong());
-System.out.println("addr in bytes is " + 
NumbersUtil.bytesToString(addr.toByteArray(), 0, addr.toByteArray().length));
-System.out.println("addr in char is " + addr.toString(":"));
-}
-
 /**
  * Parses a long from a hex encoded number. This method will 
skip
  * all characters that are not 0-9 and a-f (the String is lower cased 
first).
@@ -258,7 +236,7 @@ public class MacAddress {
  * @return a long
  * @throws NullPointerException if the String is null
  */
-public static long parseLong(String s) throws NullPointerException {
+private static long parseLong(String s) throws NullPointerException {
 s = s.toLowerCase();
 long out = 0;
 byte shifts = 0;
@@ -279,35 +257,6 @@ public class MacAddress {
 }
 
 /**
- * Parses an int from a hex encoded number. This method will 
skip
- * all characters that are not 0-9 and a-f (the String is lower cased 
first).
- * Returns 0 if the String does not contain any interesting characters.
- *
- * @param s the String to extract an int from, may not be 
null
- * @return an int
- * @throws NullPointerException if the String is null
- */
-public static int parseInt(String s) throws NullPointerException {
-s = s.toLowerCase();
-int out = 0;
-byte shifts = 0;
-char c;
-for (int i = 0; i < s.length() && shifts < 8; i++) {
-c = s.charAt(i);
-if ((c > 47) && (c < 58)) {
-out <<= 4;
-++shifts;
-out |= c - 48;
-} else if ((c > 96) && (c < 103)) {
-++shifts;
-out <<= 4;
-out |= c - 87;
-}
-}
-return out;
-}
-
-/**
  * Parses a short from a hex encoded number. This method will 
skip
  * all characters that are not 0-9 and a-f (the String is lower cased 
first).
  * Returns 0 if the String does not contain any interesting characters.
@@ -316,7 +265,7 @@ public class MacAddress {
  * @return a short
  * @throws NullPointerException if the String is null
  */
-public static short parseShort(String 

[cloudstack-cloudmonkey] branch master updated: config: create home configdir if not exist (#30)

2018-11-29 Thread rohit
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 1221e6d  config: create home configdir if not exist (#30)
1221e6d is described below

commit 1221e6d7c04bb852cd867a0fcc20eb53fd1f8a47
Author: Pierre-Luc Dion 
AuthorDate: Thu Nov 29 21:37:29 2018 -0500

config: create home configdir if not exist (#30)

Fixes #29
---
 config/config.go | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/config/config.go b/config/config.go
index 42af265..6afac68 100644
--- a/config/config.go
+++ b/config/config.go
@@ -80,7 +80,15 @@ func getDefaultConfigDir() string {
fmt.Println(err)
os.Exit(1)
}
-   return path.Join(home, ".cmk")
+   cmkHome := path.Join(home, ".cmk")
+   if _, err := os.Stat(cmkHome); os.IsNotExist(err) {
+   err := os.Mkdir(cmkHome, 0700)
+   if err != nil {
+   fmt.Println(err)
+   os.Exit(1)
+   }
+   }
+   return cmkHome
 }
 
 func defaultCoreConfig() Core {



[cloudstack] 01/01: Merge remote-tracking branch 'origin/4.11'

2018-11-30 Thread rohit
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 496a639ad734c033f26337c7b46e9c9927b9ce16
Merge: 525ddfb 44bc516
Author: Rohit Yadav 
AuthorDate: Fri Nov 30 22:26:09 2018 +0530

Merge remote-tracking branch 'origin/4.11'

Signed-off-by: Rohit Yadav 




[cloudstack] branch master updated (525ddfb -> 496a639)

2018-11-30 Thread rohit
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 525ddfb  Destroyvm also removes volumes (#2793)
 add 44bc516  api: move ostypeid from DB id to DB uuid, backports #2528 
(#3066)
 new 496a639  Merge remote-tracking branch 'origin/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:



[cloudstack-cloudmonkey] branch master updated (1221e6d -> b00b8b1)

2018-11-30 Thread rohit
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 1221e6d  config: create home configdir if not exist (#30)
 new 7f8e031  config: add debuggability using -d flag
 new b00b8b1  cli: allow parameter completion to be disables

The 2 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  |  6 ++
 cli/exec.go   |  4 
 cmd/command.go|  1 +
 cmd/network.go| 16 ++--
 cmd/set.go| 26 ++
 cmk.go|  6 ++
 config/config.go  | 36 
 config/{about.go => debug.go} | 28 +---
 8 files changed, 86 insertions(+), 37 deletions(-)
 copy config/{about.go => debug.go} (67%)



[cloudstack-cloudmonkey] 02/02: cli: allow parameter completion to be disables

2018-11-30 Thread rohit
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 b00b8b1772e0fa6c044b75a1910084fdd6afde78
Author: Rohit Yadav 
AuthorDate: Fri Nov 30 23:51:54 2018 +0530

cli: allow parameter completion to be disables

This adds the `paramcompletion` setting from python based cloudmonkey
to allow disabling of go-prompt based parameter completion logic.
This also ensure that when cursor is moved back completion won't be
shown to minimize distraction.

Fixes #32

Signed-off-by: Rohit Yadav 
---
 cli/completer.go |  6 ++
 cmd/set.go   | 26 ++
 config/config.go | 28 
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/cli/completer.go b/cli/completer.go
index 29c944f..c2a592f 100644
--- a/cli/completer.go
+++ b/cli/completer.go
@@ -71,6 +71,12 @@ func inArray(s string, array []string) bool {
 var cachedResponse map[string]interface{}
 
 func completer(in prompt.Document) []prompt.Suggest {
+   if !cfg.Core.ParamCompletion {
+   return []prompt.Suggest{}
+   }
+   if in.TextBeforeCursor() == "" || 
len(strings.TrimRight(in.TextAfterCursor(), " ")) > 0 {
+   return []prompt.Suggest{}
+   }
args := strings.Split(strings.TrimLeft(in.TextBeforeCursor(), " "), " ")
 
for i := range args {
diff --git a/cmd/set.go b/cmd/set.go
index c500190..2580a62 100644
--- a/cmd/set.go
+++ b/cmd/set.go
@@ -27,18 +27,20 @@ func init() {
Name: "set",
Help: "Configures options for cmk",
SubCommands: map[string][]string{
-   "prompt": {"🐵", "🐱", "random"},
-   "asyncblock": {"true", "false"},
-   "timeout":{"600", "1800", "3600"},
-   "output": {"json", "text", "table", "column", 
"csv"},
-   "profile":{},
-   "url":{},
-   "username":   {},
-   "password":   {},
-   "domain": {},
-   "apikey": {},
-   "secretkey":  {},
-   "verifycert": {"true", "false"},
+   "prompt":  {"🐵", "🐱", "random"},
+   "asyncblock":  {"true", "false"},
+   "timeout": {"600", "1800", "3600"},
+   "output":  {"json", "text", "table", "column", 
"csv"},
+   "profile": {},
+   "url": {},
+   "username":{},
+   "password":{},
+   "domain":  {},
+   "apikey":  {},
+   "secretkey":   {},
+   "paramcompletion": {"true", "false"},
+   "verifycert":  {"true", "false"},
+   "debug":   {"true", "false"},
},
Handle: func(r *Request) error {
if len(r.Args) < 1 {
diff --git a/config/config.go b/config/config.go
index 94dd01a..f0eafad 100644
--- a/config/config.go
+++ b/config/config.go
@@ -54,12 +54,13 @@ type ServerProfile struct {
 
 // Core block describes common options for the CLI
 type Core struct {
-   Prompt  string `ini:"prompt"`
-   AsyncBlock  bool   `ini:"asyncblock"`
-   Timeout int`ini:"timeout"`
-   Output  string `ini:"output"`
-   VerifyCert  bool   `ini:"verifycert"`
-   ProfileName string `ini:"profile"`
+   Prompt  string `ini:"prompt"`
+   AsyncBlock  bool   `ini:"asyncblock"`
+   Timeout int`ini:"timeout"`
+   Output  string `ini:"output"`
+   ParamCompletion bool   `ini:"paramcompletion"`
+   VerifyCert  bool   `ini:"verifycert"`
+   ProfileName string `ini:"profile"`
 }
 
 // Config describes CLI config file and def

[cloudstack-cloudmonkey] 01/02: config: add debuggability using -d flag

2018-11-30 Thread rohit
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 7f8e0314627fefa369cf32cfdd268d9813e3eb7d
Author: Rohit Yadav 
AuthorDate: Fri Nov 30 23:50:34 2018 +0530

config: add debuggability using -d flag

Signed-off-by: Rohit Yadav 
---
 cli/exec.go  |  4 
 cmd/command.go   |  1 +
 cmd/network.go   | 16 ++--
 cmk.go   |  6 ++
 config/config.go |  8 
 config/debug.go  | 43 +++
 6 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/cli/exec.go b/cli/exec.go
index 99bf996..c7349c3 100644
--- a/cli/exec.go
+++ b/cli/exec.go
@@ -22,13 +22,16 @@ import (
"os"
"os/exec"
"runtime"
+   "strings"
 
"github.com/apache/cloudstack-cloudmonkey/cmd"
+   "github.com/apache/cloudstack-cloudmonkey/config"
"github.com/google/shlex"
 )
 
 // ExecLine executes a line of command
 func ExecLine(line string) error {
+   config.Debug("ExecLine line:", line)
writeHistory(line)
args, err := shlex.Split(line)
if err != nil {
@@ -50,6 +53,7 @@ func ExecLine(line string) error {
 
 // ExecCmd executes a single provided command
 func ExecCmd(args []string) error {
+   config.Debug("ExecCmd args: ", strings.Join(args, ", "))
if len(args) < 1 {
return nil
}
diff --git a/cmd/command.go b/cmd/command.go
index 5788ade..ab8106c 100644
--- a/cmd/command.go
+++ b/cmd/command.go
@@ -67,6 +67,7 @@ Allowed flags:
   -vPrint version
   -oAPI response output format: json, text, table, column, csv
   -pServer profile
+  -dEnable debug mode
 
 Default commands:
 %s
diff --git a/cmd/network.go b/cmd/network.go
index 333477f..b594565 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -32,6 +32,8 @@ import (
"sort"
"strings"
"time"
+
+   "github.com/apache/cloudstack-cloudmonkey/config"
 )
 
 func findSessionCookie(cookies []*http.Cookie) *http.Cookie {
@@ -60,9 +62,11 @@ func Login(r *Request) (string, error) {
return sessionCookie.Value, nil
}
 
+   config.Debug("Login POST URL:", msURL, params)
spinner := r.Config.StartSpinner("trying to log in...")
resp, err := r.Client().PostForm(msURL.String(), params)
r.Config.StopSpinner(spinner)
+   config.Debug("Login POST response status code:", resp.StatusCode)
 
if err != nil {
return "", errors.New("failed to authenticate with the 
CloudStack server, please check the settings: " + err.Error())
@@ -92,6 +96,7 @@ func Login(r *Request) (string, error) {
r.Client().Jar, _ = cookiejar.New(nil)
}()
 
+   config.Debug("Login sessionkey:", sessionKey)
return sessionKey, nil
 }
 
@@ -197,10 +202,14 @@ func NewAPIRequest(r *Request, api string, args []string, 
isAsync bool) (map[str
return nil, errors.New("failed to authenticate to make API 
call")
}
 
-   response, err := r.Client().Get(fmt.Sprintf("%s?%s", 
r.Config.ActiveProfile.URL, encodedParams))
+   requestURL := fmt.Sprintf("%s?%s", r.Config.ActiveProfile.URL, 
encodedParams)
+   config.Debug("NewAPIRequest API request URL:", requestURL)
+
+   response, err := r.Client().Get(requestURL)
if err != nil {
return nil, err
}
+   config.Debug("NewAPIRequest response status code:", response.StatusCode)
 
if response != nil && response.StatusCode == http.StatusUnauthorized {
r.Client().Jar, _ = cookiejar.New(nil)
@@ -210,13 +219,16 @@ func NewAPIRequest(r *Request, api string, args []string, 
isAsync bool) (map[str
}
params.Del("sessionkey")
params.Add("sessionkey", sessionKey)
-   response, err = r.Client().Get(fmt.Sprintf("%s?%s", 
r.Config.ActiveProfile.URL, encodeRequestParams(params)))
+   requestURL = fmt.Sprintf("%s?%s", r.Config.ActiveProfile.URL, 
encodeRequestParams(params))
+   config.Debug("NewAPIRequest API request URL:", requestURL)
+   response, err = r.Client().Get(requestURL)
if err != nil {
return nil, err
}
}
 
body, _ := ioutil.ReadAll(response.Body)
+   config.Debug("NewAPIRequest response body:", string(body))
 
var data map[string]interface{}
_ = json.Unmarshal([]byte(body), &data)
diff --git a/cmk.go b/cmk.go
index 19d

[cloudstack-cloudmonkey] branch master updated: cli: only show autocompletion options when tab is pressed

2018-11-30 Thread rohit
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 e5d4c7e  cli: only show autocompletion options when tab is pressed
e5d4c7e is described below

commit e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 00:23:49 2018 +0530

cli: only show autocompletion options when tab is pressed

This adds constraint that the autocompletion options are only shown
when tab is pressed.

Fixes #31.

Signed-off-by: Rohit Yadav 
---
 cli/completer.go | 17 +
 cli/prompt.go|  4 
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/cli/completer.go b/cli/completer.go
index c2a592f..8fa863b 100644
--- a/cli/completer.go
+++ b/cli/completer.go
@@ -70,13 +70,19 @@ func inArray(s string, array []string) bool {
 
 var cachedResponse map[string]interface{}
 
+var tabPressed bool
+
+func tabHandler(_ *prompt.Buffer) {
+   tabPressed = true
+}
+
 func completer(in prompt.Document) []prompt.Suggest {
-   if !cfg.Core.ParamCompletion {
-   return []prompt.Suggest{}
-   }
-   if in.TextBeforeCursor() == "" || 
len(strings.TrimRight(in.TextAfterCursor(), " ")) > 0 {
+   if !cfg.Core.ParamCompletion || 
len(strings.TrimRight(in.TextAfterCursor(), " ")) > 0 || !tabPressed {
+   tabPressed = false
return []prompt.Suggest{}
}
+
+   tabPressed = false
args := strings.Split(strings.TrimLeft(in.TextBeforeCursor(), " "), " ")
 
for i := range args {
@@ -90,12 +96,14 @@ func completer(in prompt.Document) []prompt.Suggest {
apiMap := buildAPICacheMap(cfg.GetAPIVerbMap())
 
if len(args) <= 1 {
+   // API Verbs
for verb := range apiMap {
s = append(s, prompt.Suggest{
Text: verb,
})
}
} else if len(args) == 2 {
+   // API Resource
for _, api := range apiMap[args[0]] {
s = append(s, prompt.Suggest{
Text:api.Noun,
@@ -224,6 +232,7 @@ func completer(in prompt.Document) []prompt.Suggest {
}
 
} else {
+   // API parameters
for _, arg := range apiFound.Args {
if inArray(arg.Name, opts) {
continue
diff --git a/cli/prompt.go b/cli/prompt.go
index 540a927..3aa22df 100644
--- a/cli/prompt.go
+++ b/cli/prompt.go
@@ -62,6 +62,10 @@ func ExecPrompt() {
prompt.OptionDescriptionBGColor(prompt.LightGray),
prompt.OptionScrollbarThumbColor(prompt.DarkBlue),
prompt.OptionScrollbarBGColor(prompt.LightGray),
+   prompt.OptionAddKeyBind(prompt.KeyBind{
+   Key: prompt.Tab,
+   Fn:  tabHandler,
+   }),
)
shell.Run()
 }



[cloudstack-cloudmonkey] tag untagged-e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c created (now e5d4c7e)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag untagged-e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


  at e5d4c7e  (commit)
No new revisions were added by this update.



[cloudstack-cloudmonkey] 01/02: config: bump internal version to 6.0.0-beta2

2018-11-30 Thread rohit
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 30c498c89eb7350213a762e1b0b247ede7428c3e
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 00:28:42 2018 +0530

config: bump internal version to 6.0.0-beta2

Signed-off-by: Rohit Yadav 
---
 config/about.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/about.go b/config/about.go
index dccf5de..40155f4 100644
--- a/config/about.go
+++ b/config/about.go
@@ -26,7 +26,7 @@ func (c *Config) Name() string {
 
 // Version CLI
 func (c *Config) Version() string {
-   return "6.0.0-beta1"
+   return "6.0.0-beta2"
 }
 
 // PrintHeader prints startup message in CLI mode



[cloudstack-cloudmonkey] branch master updated (e5d4c7e -> c2f30ce)

2018-11-30 Thread rohit
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 e5d4c7e  cli: only show autocompletion options when tab is pressed
 new 30c498c  config: bump internal version to 6.0.0-beta2
 new c2f30ce  cmk: add git sha and build timestamp from makefile

The 2 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| 13 +++--
 cmk.go  |  9 -
 config/about.go |  2 +-
 3 files changed, 16 insertions(+), 8 deletions(-)



[cloudstack-cloudmonkey] 02/02: cmk: add git sha and build timestamp from makefile

2018-11-30 Thread rohit
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 c2f30ced06cee3d9bb58d042b6767a64596b631b
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 00:48:29 2018 +0530

cmk: add git sha and build timestamp from makefile

With this change `cmk -v` will output git sha and build timestamp.

Signed-off-by: Rohit Yadav 
---
 Makefile | 13 +++--
 cmk.go   |  9 -
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 7bb027e..174c58a 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ BIN  = $(CURDIR)/bin
 BASE = $(CURDIR)
 PKGS = $(or $(PKG),$(shell $(GO) list ./... | grep -v 
"^$(PACKAGE)/vendor/"))
 TESTPKGS = $(shell $(GO) list -f '{{ if or .TestGoFiles .XTestGoFiles }}{{ 
.ImportPath }}{{ end }}' $(PKGS))
+GIT_SHA  = $(shell git rev-parse --short HEAD)
 
 GO  = go
 GODOC   = godoc
@@ -34,10 +35,10 @@ Q = $(if $(filter 1,$V),,@)
 M = $(shell printf "\033[34;1m▶\033[0m ")
 
 .PHONY: all
-all: fmt ; $(info $(M) Building executable…) @ ## Build program binary
+all: fmt ; $(info $(M) Building executable… $(GIT_SHA)) @ ## Build program 
binary
$Q $(GO) build -mod=vendor \
-tags release \
-   -ldflags '-s -w -X $(PACKAGE)/cmd.Version=$(VERSION) -X 
$(PACKAGE)/cmd.BuildDate=$(DATE)' \
+   -ldflags '-s -w -X main.GitSHA=$(GIT_SHA) -X 
main.BuildDate=$(DATE)' \
-o bin/$(PACKAGE) cmk.go
$(info $(M) Done!) @
 
@@ -50,10 +51,10 @@ debug:
 dist: all
rm -fr dist
mkdir -p dist
-   GOOS=linux   GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o 
dist/cmk.linux.amd64 cmk.go
-   GOOS=linux   GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w' -o 
dist/cmk.linux.arm64 cmk.go
-   GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o 
dist/cmk.exe cmk.go
-   GOOS=darwin  GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o 
dist/cmk.darwin.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.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=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
 
 # Tools
 
diff --git a/cmk.go b/cmk.go
index 1afc26e..fad4f49 100644
--- a/cmk.go
+++ b/cmk.go
@@ -27,6 +27,12 @@ import (
"github.com/apache/cloudstack-cloudmonkey/config"
 )
 
+// GitSHA holds the git SHA
+var GitSHA string
+
+// BuildDate holds the build datetime
+var BuildDate string
+
 func init() {
flag.Usage = func() {
cmd.PrintUsage()
@@ -38,12 +44,13 @@ func main() {
showVersion := flag.Bool("v", false, "show version")
debug := flag.Bool("d", false, "enable debug mode")
profile := flag.String("p", "", "server profile")
+
flag.Parse()
 
cfg := config.NewConfig()
 
if *showVersion {
-   fmt.Println(cfg.Name(), cfg.Version())
+   fmt.Printf("%s %s (build: %s, %s)\n", cfg.Name(), 
cfg.Version(), GitSHA, BuildDate)
os.Exit(0)
}
 



[cloudstack-cloudmonkey] tag untagged-e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c deleted (was e5d4c7e)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag untagged-e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


*** WARNING: tag untagged-e5d4c7e244afb5c3a0fc28adc99a0b6a3f44877c was deleted! 
***

 was e5d4c7e  cli: only show autocompletion options when tab is pressed

The revisions that were on this tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack-cloudmonkey] tag untagged-8cd301679ee29617066c deleted (was c515cbb)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag untagged-8cd301679ee29617066c
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


*** WARNING: tag untagged-8cd301679ee29617066c was deleted! ***

 was c515cbb  cmd: handle errors well, throw non-zero exit code on error

The revisions that were on this tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack-cloudmonkey] tag 6.0.0-testing-beta2 created (now c2f30ce)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag 6.0.0-testing-beta2
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


  at c2f30ce  (commit)
No new revisions were added by this update.



[cloudstack-cloudmonkey] branch master updated: network: fix segfault

2018-11-30 Thread rohit
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 a8beed7  network: fix segfault
a8beed7 is described below

commit a8beed7912f78a0a211d45c74a40abb0fa045b12
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 01:05:57 2018 +0530

network: fix segfault

Fixes segfault issue when response is invalid (nil).

Signed-off-by: Rohit Yadav 
---
 cmd/network.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/network.go b/cmd/network.go
index b594565..e02c11b 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -66,12 +66,12 @@ func Login(r *Request) (string, error) {
spinner := r.Config.StartSpinner("trying to log in...")
resp, err := r.Client().PostForm(msURL.String(), params)
r.Config.StopSpinner(spinner)
-   config.Debug("Login POST response status code:", resp.StatusCode)
 
if err != nil {
return "", errors.New("failed to authenticate with the 
CloudStack server, please check the settings: " + err.Error())
}
 
+   config.Debug("Login POST response status code:", resp.StatusCode)
if resp.StatusCode != http.StatusOK {
e := errors.New("failed to authenticate, please check the 
credentials")
if err != nil {



[cloudstack-cloudmonkey] tag 6.0.0-testing-beta2 deleted (was c2f30ce)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag 6.0.0-testing-beta2
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


*** WARNING: tag 6.0.0-testing-beta2 was deleted! ***

 was c2f30ce  cmk: add git sha and build timestamp from makefile

The revisions that were on this tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack-cloudmonkey] tag 6.0.0-testing-beta2 created (now a8beed7)

2018-11-30 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag 6.0.0-testing-beta2
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


  at a8beed7  (commit)
No new revisions were added by this update.



[cloudstack] branch 4.11 updated: packaging: correct permissions in spec file and fix class path specified variable (#3030)

2018-11-30 Thread rohit
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 1709792  packaging: correct permissions in spec file and fix class 
path specified variable (#3030)
1709792 is described below

commit 17097929b666263c559ed18ad28e91105191fd8d
Author: Sven Vogel 
AuthorDate: Fri Nov 30 21:08:01 2018 +0100

packaging: correct permissions in spec file and fix class path specified 
variable (#3030)

Install CentOS 7 e.g. Build 1804 and Java build 1.8.0_181

if you inspect systemd in debug mode you will see some errors
1.
permission of the cloudstack-managment.service are not corretly set
2.
invalid classpath specified. it seems the string which is used will be 
divided... we now we use ${..} like the lines above ... confused
---
 packaging/centos7/cloud.spec| 2 +-
 packaging/systemd/cloudstack-management.service | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 38f90ce..1cc8993 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -486,7 +486,7 @@ pip install --upgrade 
/usr/share/cloudstack-marvin/Marvin-*.tar.gz
 %config(noreplace) %{_sysconfdir}/%{name}/management/environment.properties
 %config(noreplace) %{_sysconfdir}/%{name}/management/java.security.ciphers
 %config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties
-%attr(0755,root,root) %{_unitdir}/%{name}-management.service
+%attr(0644,root,root) %{_unitdir}/%{name}-management.service
 %attr(0755,cloud,cloud) %{_localstatedir}/run/%{name}-management.pid
 %attr(0755,root,root) %{_bindir}/%{name}-setup-management
 %attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses
diff --git a/packaging/systemd/cloudstack-management.service 
b/packaging/systemd/cloudstack-management.service
index afcea8c..58c4343 100644
--- a/packaging/systemd/cloudstack-management.service
+++ b/packaging/systemd/cloudstack-management.service
@@ -28,8 +28,8 @@ Environment="NAME=cloudstack-management"
 EnvironmentFile=/etc/default/cloudstack-management
 ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JAVA_HOME=$( 
readlink -f $( which java ) | sed s:bin/.*$:: )"
 ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JARS=$(ls 
/usr/share/cloudstack-management/lib/*.jar | tr '\n' ':' | sed s'/.$//')"
-ExecStart=/usr/bin/jsvc -home "${JAVA_HOME}" -user "${CLOUDSTACK_USER}" -cp 
"${JARS}:${CLASSPATH}" -errfile ${LOGDIR}/${NAME}.err -cwd ${LOGDIR} -pidfile 
"${CLOUDSTACK_PID}" ${JAVA_OPTS} "${BOOTSTRAP_CLASS}"
-ExecStop=/usr/bin/jsvc -cp "$JARS:$CLASSPATH" -pidfile "$CLOUDSTACK_PID" -stop 
"$BOOTSTRAP_CLASS"
+ExecStart=/usr/bin/jsvc -home "${JAVA_HOME}" -user "${CLOUDSTACK_USER}" -cp 
"${JARS}:${CLASSPATH}" -errfile "${LOGDIR}/${NAME}.err" -cwd "${LOGDIR}" 
-pidfile "${CLOUDSTACK_PID}" "${JAVA_OPTS}" "${BOOTSTRAP_CLASS}"
+ExecStop=/usr/bin/jsvc -cp "${JARS}:${CLASSPATH}" -pidfile "${CLOUDSTACK_PID}" 
-stop "${BOOTSTRAP_CLASS}"
 SuccessExitStatus=143
 
 [Install]



[cloudstack-cloudmonkey] 02/02: cli: use cyan as selected colour, don't bolden the input

2018-12-01 Thread rohit
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 1001560b4f2879f1c9447d20c751c47d9fd807fe
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 23:46:04 2018 +0530

cli: use cyan as selected colour, don't bolden the input

Signed-off-by: Rohit Yadav 
---
 cli/prompt.go| 14 +++---
 cmd/api.go   |  4 ++--
 vendor/github.com/c-bata/go-prompt/completion.go |  2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/cli/prompt.go b/cli/prompt.go
index 3aa22df..1e42349 100644
--- a/cli/prompt.go
+++ b/cli/prompt.go
@@ -51,21 +51,29 @@ func ExecPrompt() {
}),
prompt.OptionMaxSuggestion(5),
prompt.OptionPrefixTextColor(prompt.DefaultColor),
-   prompt.OptionPreviewSuggestionTextColor(prompt.DarkBlue),
+   prompt.OptionPreviewSuggestionTextColor(prompt.DefaultColor),
prompt.OptionSelectedSuggestionTextColor(prompt.White),
-   prompt.OptionSelectedSuggestionBGColor(prompt.DarkBlue),
+   prompt.OptionSelectedSuggestionBGColor(prompt.Cyan),
prompt.OptionSelectedDescriptionTextColor(prompt.White),
prompt.OptionSelectedDescriptionBGColor(prompt.DarkGray),
prompt.OptionSuggestionTextColor(prompt.Black),
prompt.OptionSuggestionBGColor(prompt.White),
prompt.OptionDescriptionTextColor(prompt.Black),
prompt.OptionDescriptionBGColor(prompt.LightGray),
-   prompt.OptionScrollbarThumbColor(prompt.DarkBlue),
+   prompt.OptionScrollbarThumbColor(prompt.Cyan),
prompt.OptionScrollbarBGColor(prompt.LightGray),
prompt.OptionAddKeyBind(prompt.KeyBind{
Key: prompt.Tab,
Fn:  tabHandler,
}),
+   prompt.OptionAddKeyBind(prompt.KeyBind{
+   Key: prompt.Up,
+   Fn:  tabHandler,
+   }),
+   prompt.OptionAddKeyBind(prompt.KeyBind{
+   Key: prompt.Down,
+   Fn:  tabHandler,
+   }),
)
shell.Run()
 }
diff --git a/cmd/api.go b/cmd/api.go
index 3ba7ea4..b84f919 100644
--- a/cmd/api.go
+++ b/cmd/api.go
@@ -62,7 +62,7 @@ func init() {
for _, required := range api.RequiredArgs {
provided := false
for _, arg := range apiArgs {
-   if strings.HasPrefix(arg, required) {
+   if strings.Contains(arg, "=") && 
strings.HasPrefix(arg, required) {
provided = true
}
}
@@ -72,7 +72,7 @@ func init() {
}
 
if len(missingArgs) > 0 {
-   fmt.Println("💩 Missing required arguments: ", 
strings.Join(missingArgs, ", "))
+   fmt.Println("💩 Missing required parameters: ", 
strings.Join(missingArgs, ", "))
return nil
}
 
diff --git a/vendor/github.com/c-bata/go-prompt/completion.go 
b/vendor/github.com/c-bata/go-prompt/completion.go
index 6687987..bbb8dbb 100644
--- a/vendor/github.com/c-bata/go-prompt/completion.go
+++ b/vendor/github.com/c-bata/go-prompt/completion.go
@@ -41,7 +41,7 @@ type CompletionManager struct {
 
 // GetSelectedSuggestion returns the selected item.
 func (c *CompletionManager) GetSelectedSuggestion() (s Suggest, ok bool) {
-   if c.selected == -1 {
+   if c.selected == -1 || len(c.tmp) < 1 {
return Suggest{}, false
} else if c.selected < -1 {
log.Printf("[ERROR] shoud be reached here, selected=%d", 
c.selected)



[cloudstack-cloudmonkey] branch master updated (a8beed7 -> 1001560)

2018-12-01 Thread rohit
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 a8beed7  network: fix segfault
 new 977d6bd  vendor: update vendoring dependencies
 new 1001560  cli: use cyan as selected colour, don't bolden the input

The 2 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/prompt.go  | 14 +++-
 cmd/api.go |  4 +-
 go.mod |  4 +-
 go.sum | 11 ++-
 vendor/github.com/c-bata/go-prompt/CHANGELOG.md| 19 +-
 vendor/github.com/c-bata/go-prompt/README.md   | 28 +++-
 vendor/github.com/c-bata/go-prompt/completion.go   |  3 +-
 vendor/github.com/c-bata/go-prompt/emacs.go|  7 +-
 vendor/github.com/c-bata/go-prompt/filter.go   | 79 +++---
 vendor/github.com/c-bata/go-prompt/input_posix.go  |  9 ++-
 vendor/github.com/c-bata/go-prompt/option.go   | 14 +++-
 vendor/github.com/c-bata/go-prompt/output.go   | 13 
 vendor/github.com/c-bata/go-prompt/output_posix.go | 41 +--
 vendor/github.com/c-bata/go-prompt/output_vt100.go |  4 +-
 .../github.com/c-bata/go-prompt/output_windows.go  | 17 -
 vendor/github.com/c-bata/go-prompt/prompt.go   |  8 +++
 vendor/modules.txt |  2 +-
 17 files changed, 210 insertions(+), 67 deletions(-)



[cloudstack-cloudmonkey] 01/02: vendor: update vendoring dependencies

2018-12-01 Thread rohit
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 977d6bd31b5b2f9a8cc03564513b7526c4cb387b
Author: Rohit Yadav 
AuthorDate: Sat Dec 1 23:21:59 2018 +0530

vendor: update vendoring dependencies

Signed-off-by: Rohit Yadav 
---
 go.mod |  4 +-
 go.sum | 11 ++-
 vendor/github.com/c-bata/go-prompt/CHANGELOG.md| 19 +-
 vendor/github.com/c-bata/go-prompt/README.md   | 28 +++-
 vendor/github.com/c-bata/go-prompt/completion.go   |  1 +
 vendor/github.com/c-bata/go-prompt/emacs.go|  7 +-
 vendor/github.com/c-bata/go-prompt/filter.go   | 79 +++---
 vendor/github.com/c-bata/go-prompt/input_posix.go  |  9 ++-
 vendor/github.com/c-bata/go-prompt/option.go   | 14 +++-
 vendor/github.com/c-bata/go-prompt/output.go   | 13 
 vendor/github.com/c-bata/go-prompt/output_posix.go | 41 +--
 vendor/github.com/c-bata/go-prompt/output_vt100.go |  4 +-
 .../github.com/c-bata/go-prompt/output_windows.go  | 17 -
 vendor/github.com/c-bata/go-prompt/prompt.go   |  8 +++
 vendor/modules.txt |  2 +-
 15 files changed, 196 insertions(+), 61 deletions(-)

diff --git a/go.mod b/go.mod
index d403cd0..99642a2 100644
--- a/go.mod
+++ b/go.mod
@@ -19,12 +19,13 @@ module github.com/apache/cloudstack-cloudmonkey
 
 require (
github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20
-   github.com/c-bata/go-prompt v0.2.2
+   github.com/c-bata/go-prompt v0.2.3
github.com/fatih/color v1.7.0 // indirect
github.com/gofrs/flock v0.7.0
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9
github.com/gopherjs/gopherjs v0.0.0-20181017120253-077cb4d1 // 
indirect
github.com/jtolds/gls v4.2.1+incompatible // indirect
+   github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mattn/go-runewidth v0.0.3 // indirect
@@ -35,5 +36,6 @@ require (
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d 
// indirect
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // 
indirect
golang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8 // indirect
+   gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/ini.v1 v1.39.0
 )
diff --git a/go.sum b/go.sum
index 5bf1766..e19de37 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
 github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20 
h1:kWWOFAhyzkpi4/+L3++mYiZbuxh1TqYkDMHfFjk6ZfE=
 github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20/go.mod 
h1:hw/JEQBIE+c/BLI4aKM8UU8v+ZqrD3h7HC27kKt8JQU=
-github.com/c-bata/go-prompt v0.2.2 
h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0=
-github.com/c-bata/go-prompt v0.2.2/go.mod 
h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
+github.com/c-bata/go-prompt v0.2.3 
h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2s=
+github.com/c-bata/go-prompt v0.2.3/go.mod 
h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
 github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
 github.com/fatih/color v1.7.0/go.mod 
h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/gofrs/flock v0.7.0 h1:pGFUjl501gafK9HBt1VGL1KCOd/YhIooID+xgyJCf3g=
@@ -12,6 +12,11 @@ github.com/gopherjs/gopherjs 
v0.0.0-20181017120253-077cb4d1 h1:EGx4pi6eqNxGa
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-077cb4d1/go.mod 
h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/jtolds/gls v4.2.1+incompatible 
h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
 github.com/jtolds/gls v4.2.1+incompatible/go.mod 
h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod 
h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod 
h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/mattn/go-colorable v0.0.9 
h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
 github.com/mattn/go-colorable v0.0.9/go.mod 
h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-isatty v0.0.4 
h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
@@ -32,5 +37,7 @@ github.com/smartystreets/goconvey 
v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbm
 github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod 
h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
 golang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8 
h1:R91KX5nmbbvEd7w370cbVzKC+EzCTGqZq63Zad5IcLM=
 golang.org/x/sys v0.0.0

[cloudstack-cloudmonkey] branch master updated: network: remove nested quotes in parameters

2018-12-03 Thread rohit
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 f3e0992  network: remove nested quotes in parameters
f3e0992 is described below

commit f3e09928f940bd2d17283f117bc61eef272670ea
Author: Rohit Yadav 
AuthorDate: Mon Dec 3 17:21:07 2018 +0530

network: remove nested quotes in parameters

Signed-off-by: Rohit Yadav 
---
 cmd/network.go | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmd/network.go b/cmd/network.go
index e02c11b..3ab1358 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -169,7 +169,12 @@ func NewAPIRequest(r *Request, api string, args []string, 
isAsync bool) (map[str
for _, arg := range args {
parts := strings.SplitN(arg, "=", 2)
if len(parts) == 2 {
-   params.Add(parts[0], parts[1])
+   key := parts[0]
+   value := parts[1]
+   if strings.HasPrefix(value, "\"") && 
strings.HasSuffix(value, "\"") {
+   value = value[1 : len(value)-1]
+   }
+   params.Add(key, value)
}
}
params.Add("response", "json")



[cloudstack] branch 4.11 updated: security: increase keystore setup/import timeout (#3076)

2018-12-03 Thread rohit
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 89c567a  security: increase keystore setup/import timeout (#3076)
89c567a is described below

commit 89c567add8486ada7528dd7cb2482d7ea43b0d45
Author: Rohit Yadav 
AuthorDate: Tue Dec 4 01:28:24 2018 +0530

security: increase keystore setup/import timeout (#3076)

This increases and uses a default 15mins timeout for VR scripts and for
KVM agent increases timeout from 60s to 5mins. The timeout can
specifically occur when keystore does not get enough entropy from CPU
and script gets killed due to timeout. This is a very specific corner
case and generally should not happen on baremetal/prod environment, but
sometimes seen in nested/test environments.

Signed-off-by: Rohit Yadav 
---
 agent/src/com/cloud/agent/Agent.java  | 4 ++--
 .../cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/agent/src/com/cloud/agent/Agent.java 
b/agent/src/com/cloud/agent/Agent.java
index f1f2116..df0448d 100644
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -729,7 +729,7 @@ public class Agent implements HandlerFactory, IAgentControl 
{
 _shell.setPersistentProperty(null, 
KeyStoreUtils.KS_PASSPHRASE_PROPERTY, storedPassword);
 }
 
-Script script = new Script(_keystoreSetupPath, 6, s_logger);
+Script script = new Script(_keystoreSetupPath, 30, s_logger);
 script.add(agentFile.getAbsolutePath());
 script.add(keyStoreFile);
 script.add(storedPassword);
@@ -773,7 +773,7 @@ public class Agent implements HandlerFactory, IAgentControl 
{
 throw new CloudRuntimeException("Unable to save received agent 
client and ca certificates", e);
 }
 
-Script script = new Script(_keystoreCertImportPath, 6, s_logger);
+Script script = new Script(_keystoreCertImportPath, 30, s_logger);
 script.add(agentFile.getAbsolutePath());
 script.add(keyStoreFile);
 script.add(KeyStoreUtils.AGENT_MODE);
diff --git 
a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java 
b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index 0ffe8cc..1367218 100644
--- 
a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ 
b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -161,7 +161,7 @@ public class VirtualRoutingResource {
 cmd.getKeystorePassword(),
 cmd.getValidityDays(),
 KeyStoreUtils.CSR_FILENAME);
-ExecutionResult result = 
_vrDeployer.executeInVR(cmd.getRouterAccessIp(), KeyStoreUtils.KS_SETUP_SCRIPT, 
args);
+ExecutionResult result = 
_vrDeployer.executeInVR(cmd.getRouterAccessIp(), KeyStoreUtils.KS_SETUP_SCRIPT, 
args, Duration.standardMinutes(15));
 return new SetupKeystoreAnswer(result.getDetails());
 }
 
@@ -179,7 +179,7 @@ public class VirtualRoutingResource {
 cmd.getEncodedCaCertificates(),
 KeyStoreUtils.PKEY_FILENAME,
 cmd.getEncodedPrivateKey());
-ExecutionResult result = 
_vrDeployer.executeInVR(cmd.getRouterAccessIp(), 
KeyStoreUtils.KS_IMPORT_SCRIPT, args);
+ExecutionResult result = 
_vrDeployer.executeInVR(cmd.getRouterAccessIp(), 
KeyStoreUtils.KS_IMPORT_SCRIPT, args, Duration.standardMinutes(15));
 return new SetupCertificateAnswer(result.isSuccess());
 }
 



[cloudstack] branch 4.11 updated: api: Discover tags field on superclass of API responses (#3005)

2018-12-04 Thread rohit
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 290df5f  api: Discover tags field on superclass of API responses 
(#3005)
290df5f is described below

commit 290df5f42351f4c12197b2a71a4d6bb6dfc13529
Author: Craig Squire 
AuthorDate: Tue Dec 4 02:29:48 2018 -0600

api: Discover tags field on superclass of API responses (#3005)

Updated ApiServiceDiscoveryImpl to check superclasses of API responses for 
fields.

Fixes: #3002
---
 .../api/response/ApiDiscoveryResponse.java | 12 ++--
 .../api/response/ApiResponseResponse.java  | 24 ++--
 .../discovery/ApiDiscoveryServiceImpl.java | 42 +++---
 .../cloudstack/discovery/ApiDiscoveryTest.java | 66 ++
 4 files changed, 90 insertions(+), 54 deletions(-)

diff --git 
a/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiDiscoveryResponse.java
 
b/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiDiscoveryResponse.java
index 64e6ef9..dccf5a6 100644
--- 
a/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiDiscoveryResponse.java
+++ 
b/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiDiscoveryResponse.java
@@ -16,15 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import java.util.HashSet;
-import java.util.Set;
-
+import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 
-import com.cloud.serializer.Param;
+import java.util.HashSet;
+import java.util.Set;
 
 @SuppressWarnings("unused")
 public class ApiDiscoveryResponse extends BaseResponse {
@@ -121,4 +119,8 @@ public class ApiDiscoveryResponse extends BaseResponse {
 public void addApiResponse(ApiResponseResponse apiResponse) {
 this.apiResponse.add(apiResponse);
 }
+
+public Set getApiResponse() {
+return apiResponse;
+}
 }
diff --git 
a/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiResponseResponse.java
 
b/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiResponseResponse.java
index ba1301b..9844df1 100644
--- 
a/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiResponseResponse.java
+++ 
b/plugins/api/discovery/src/org/apache/cloudstack/api/response/ApiResponseResponse.java
@@ -16,15 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import java.util.HashSet;
-import java.util.Set;
-
+import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 
-import com.cloud.serializer.Param;
+import java.util.HashSet;
+import java.util.Set;
 
 public class ApiResponseResponse extends BaseResponse {
 @SerializedName(ApiConstants.NAME)
@@ -61,4 +59,20 @@ public class ApiResponseResponse extends BaseResponse {
 }
 this.apiResponse.add(childApiResponse);
 }
+
+public String getName() {
+return name;
+}
+
+public String getDescription() {
+return description;
+}
+
+public String getType() {
+return type;
+}
+
+public Set getApiResponse() {
+return apiResponse;
+}
 }
diff --git 
a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
 
b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
index 3408a77..62164db 100644
--- 
a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
+++ 
b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
@@ -16,21 +16,13 @@
 // under the License.
 package org.apache.cloudstack.discovery;
 
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
+import com.cloud.serializer.Param;
+import com.cloud.user.User;
+import com.cloud.utils.ReflectUtil;
+import com.cloud.utils.StringUtils;
+import com.cloud.utils.component.ComponentLifecycleBase;
+import com.cloud.utils.component.PluggableService;
 import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.acl.APIChecker;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -43,13 +35,18 @@ import 
org.apache.cloudstack.api.response.ApiDiscoveryResponse;
 import org.apache.cloudstack.api.response.ApiParameterResponse;
 import org.apache.cloudstack.api.response.ApiResponseRespons

[cloudstack] 01/01: Merge remote-tracking branch 'origin/4.11'

2018-12-04 Thread rohit
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 52f68a273aaf0aa6746eaaee4a95a7bf722c53b0
Merge: 496a639 290df5f
Author: Rohit Yadav 
AuthorDate: Tue Dec 4 16:39:21 2018 +0530

Merge remote-tracking branch 'origin/4.11'

Signed-off-by: Rohit Yadav 

 agent/src/main/java/com/cloud/agent/Agent.java |  4 +-
 .../virtualnetwork/VirtualRoutingResource.java |  4 +-
 packaging/centos7/cloud.spec   |  2 +-
 packaging/systemd/cloudstack-management.service|  4 +-
 .../api/response/ApiDiscoveryResponse.java | 12 ++--
 .../api/response/ApiResponseResponse.java  | 24 ++--
 .../discovery/ApiDiscoveryServiceImpl.java | 42 +++---
 .../cloudstack/discovery/ApiDiscoveryTest.java | 66 ++
 8 files changed, 97 insertions(+), 61 deletions(-)

diff --cc 
core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index 112d920,000..21372a1
mode 100644,00..100644
--- 
a/core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ 
b/core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@@ -1,473 -1,0 +1,473 @@@
 +//
 +// 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.agent.resource.virtualnetwork;
 +
 +import java.io.IOException;
 +import java.net.InetSocketAddress;
 +import java.nio.channels.SocketChannel;
 +
 +import org.apache.cloudstack.diagnostics.DiagnosticsAnswer;
 +import org.apache.cloudstack.diagnostics.DiagnosticsCommand;
 +import org.joda.time.Duration;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Queue;
 +import java.util.UUID;
 +import java.util.concurrent.LinkedBlockingQueue;
 +import java.util.concurrent.locks.Lock;
 +import java.util.concurrent.locks.ReentrantLock;
 +
 +import javax.naming.ConfigurationException;
 +
 +import org.apache.cloudstack.ca.SetupCertificateAnswer;
 +import org.apache.cloudstack.ca.SetupCertificateCommand;
 +import org.apache.cloudstack.ca.SetupKeyStoreCommand;
 +import org.apache.cloudstack.ca.SetupKeystoreAnswer;
 +import org.apache.cloudstack.utils.security.KeyStoreUtils;
 +import org.apache.log4j.Logger;
 +
 +import com.cloud.agent.api.Answer;
 +import com.cloud.agent.api.CheckRouterAnswer;
 +import com.cloud.agent.api.CheckRouterCommand;
 +import com.cloud.agent.api.CheckS2SVpnConnectionsAnswer;
 +import com.cloud.agent.api.CheckS2SVpnConnectionsCommand;
 +import com.cloud.agent.api.GetDomRVersionAnswer;
 +import com.cloud.agent.api.GetDomRVersionCmd;
 +import com.cloud.agent.api.GetRouterAlertsAnswer;
 +import com.cloud.agent.api.routing.AggregationControlCommand;
 +import com.cloud.agent.api.routing.AggregationControlCommand.Action;
 +import com.cloud.agent.api.routing.GetRouterAlertsCommand;
 +import com.cloud.agent.api.routing.GroupAnswer;
 +import com.cloud.agent.api.routing.NetworkElementCommand;
 +import 
com.cloud.agent.resource.virtualnetwork.facade.AbstractConfigItemFacade;
 +import com.cloud.utils.ExecutionResult;
 +import com.cloud.utils.NumbersUtil;
 +import com.cloud.utils.exception.CloudRuntimeException;
 +
 +/**
 + * VirtualNetworkResource controls and configures virtual networking
 + *
 + * @config
 + * {@table
 + *|| Param Name | Description | Values | Default ||
 + *  }
 + **/
 +public class VirtualRoutingResource {
 +
 +private static final Logger s_logger = 
Logger.getLogger(VirtualRoutingResource.class);
 +private VirtualRouterDeployer _vrDeployer;
 +private Map> _vrAggregateCommandsSet;
 +protected Map _vrLockMap = new HashMap();
 +
 +private String _name;
 +private int _sleep;
 +private int _retry;
 +private int _port;
 +private Duration _eachTimeout;
 +private Map _params;
 +
 +private String _cfgVersion = "1.0";
 +
 +public VirtualRoutingResource(VirtualRouterDeployer deployer) {
 +_vrDeployer = deployer;
 +}
 +
 +public Answer exe

[cloudstack] branch master updated (496a639 -> 52f68a2)

2018-12-04 Thread rohit
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 496a639  Merge remote-tracking branch 'origin/4.11'
 add 1709792  packaging: correct permissions in spec file and fix class 
path specified variable (#3030)
 add 89c567a  security: increase keystore setup/import timeout (#3076)
 add 290df5f  api: Discover tags field on superclass of API responses 
(#3005)
 new 52f68a2  Merge remote-tracking branch 'origin/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/src/main/java/com/cloud/agent/Agent.java |  4 +-
 .../virtualnetwork/VirtualRoutingResource.java |  4 +-
 packaging/centos7/cloud.spec   |  2 +-
 packaging/systemd/cloudstack-management.service|  4 +-
 .../api/response/ApiDiscoveryResponse.java | 12 ++--
 .../api/response/ApiResponseResponse.java  | 24 ++--
 .../discovery/ApiDiscoveryServiceImpl.java | 42 +++---
 .../cloudstack/discovery/ApiDiscoveryTest.java | 66 ++
 8 files changed, 97 insertions(+), 61 deletions(-)



[cloudstack-cloudmonkey] branch master updated: README: fix golang version

2018-12-05 Thread rohit
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 fc79e76  README: fix golang version
fc79e76 is described below

commit fc79e76742e4c42b8e12f44066254c964a9a98de
Author: Rohit Yadav 
AuthorDate: Wed Dec 5 16:39:10 2018 +0530

README: fix golang version

Signed-off-by: Rohit Yadav 
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index edd98ac..1a990a0 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ For documentation, kindly see the 
[wiki](https://github.com/apache/cloudstack-cl
 
 ### Development
 
-For development the pre-requisites are Go 10 or latest and a unix-like
+For development the pre-requisites are Go 1.11 or latest and a unix-like
 environment. You can use the following targets for building:
 
 $ make help



[cloudstack] branch master updated: kvm: Use 'ip route show default 0.0.0.0/0' to find the default gateway (#3080)

2018-12-06 Thread rohit
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 d96bc05  kvm: Use 'ip route show default 0.0.0.0/0' to find the 
default gateway (#3080)
d96bc05 is described below

commit d96bc05d10d0e5ca8f6e232e8de68398dadf8afb
Author: Wido den Hollander 
AuthorDate: Thu Dec 6 09:34:47 2018 +0100

kvm: Use 'ip route show default 0.0.0.0/0' to find the default gateway 
(#3080)

If a host has many routes this can be a magnitude faster then printing
all the routes and grepping for the default.

In some situations the host might have a large amount of routes due to
dynamic routing being used like OSPF or BGP.

In addition fix a couple of loglines which were throwing messages on
DEBUG while WARN and ERROR should be used there.

Signed-off-by: Wido den Hollander 
---
 .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 26fcd01..cf6f610 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1015,21 +1015,21 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
 */
 
 if (_pifs.get("private") == null) {
-s_logger.debug("Failed to get private nic name");
+s_logger.error("Failed to get private nic name");
 throw new ConfigurationException("Failed to get private nic name");
 }
 
 if (_pifs.get("public") == null) {
-s_logger.debug("Failed to get public nic name");
+s_logger.error("Failed to get public nic name");
 throw new ConfigurationException("Failed to get public nic name");
 }
 s_logger.debug("Found pif: " + _pifs.get("private") + " on " + 
_privBridgeName + ", pif: " + _pifs.get("public") + " on " + _publicBridgeName);
 
 _canBridgeFirewall = canBridgeFirewall(_pifs.get("public"));
 
-_localGateway = Script.runSimpleBashScript("ip route |grep default|awk 
'{print $3}'");
+_localGateway = Script.runSimpleBashScript("ip route show default 
0.0.0.0/0|head -1|awk '{print $3}'");
 if (_localGateway == null) {
-s_logger.debug("Failed to found the local gateway");
+s_logger.warn("No default IPv4 gateway found");
 }
 
 _mountPoint = (String)params.get("mount.path");



[cloudstack] branch master updated: kvm: Added two more device name patterns to valid bridge slaves (lo* and dummy*) (#3000)

2018-12-06 Thread rohit
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 9dce8a5  kvm: Added two more device name patterns to valid bridge 
slaves (lo* and dummy*) (#3000)
9dce8a5 is described below

commit 9dce8a5dea508a69d31dd4159c566fdf119c223e
Author: Bitworks LLC 
AuthorDate: Thu Dec 6 15:29:00 2018 -0500

kvm: Added two more device name patterns to valid bridge slaves (lo* and 
dummy*) (#3000)

Added dummy and lo devices to be treated as a normal bridge slave devs.
Fixes #2998
Added two more device names (lo* and dummy*). Implemented tests. Code was 
refactored.
Improved paths concatenation code from "+" to Paths.get.
---
 .../hypervisor/kvm/resource/BridgeVifDriver.java   | 31 +
 .../kvm/resource/LibvirtComputingResource.java | 52 --
 .../kvm/resource/LibvirtComputingResourceTest.java | 40 +++--
 3 files changed, 57 insertions(+), 66 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 39b92c3..ebaf23f 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
@@ -170,7 +170,7 @@ public class BridgeVifDriver extends VifDriverBase {
 for (File anInterface : interfaces) {
 final String fname = anInterface.getName();
 s_logger.debug("matchPifFileInDirectory: file name '" + fname + 
"'");
-if (isInterface(fname)) {
+if (LibvirtComputingResource.isInterface(fname)) {
 return fname;
 }
 }
@@ -179,33 +179,6 @@ public class BridgeVifDriver extends VifDriverBase {
 return "";
 }
 
-private static final String [] IF_NAME_PATTERNS = {
-"^eth",
-"^bond",
-"^vlan",
-"^vx",
-"^em",
-"^ens",
-"^eno",
-"^enp",
-"^team",
-"^enx",
-"^p\\d+p\\d+"
-};
-
-/**
- * @param fname
- * @return
- */
-private static boolean isInterface(final String fname) {
-StringBuilder commonPattern = new StringBuilder();
-for (final String ifNamePattern : IF_NAME_PATTERNS) {
-commonPattern.append("|(").append(ifNamePattern).append(".*)");
-}
-
-return fname.matches(commonPattern.toString());
-}
-
 protected boolean isBroadcastTypeVlanOrVxlan(final NicTO nic) {
 return nic != null && (nic.getBroadcastType() == 
Networks.BroadcastDomainType.Vlan
 || nic.getBroadcastType() == 
Networks.BroadcastDomainType.Vxlan);
@@ -432,7 +405,7 @@ public class BridgeVifDriver extends VifDriverBase {
 }
 if (!foundLinkLocalBr) {
 Script.runSimpleBashScript("ip address add 169.254.0.1/16 dev " + 
linkLocalBr + ";" + "ip route add " + NetUtils.getLinkLocalCIDR() + " dev " + 
linkLocalBr + " src " +
-NetUtils.getLinkLocalGateway());
+NetUtils.getLinkLocalGateway());
 }
 }
 
diff --git 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index cf6f610..ac92f37 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -26,6 +26,7 @@ import java.io.StringReader;
 import java.net.InetAddress;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
@@ -278,7 +279,7 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
 protected String _rngPath = "/dev/random";
 protected int _rngRatePeriod = 1000;
 protected int _rngRateBytes = 2048;
-private File _qemuSocketsPath;
+protected File _qemuSocketsPath;
 private final String _qemuGuestAgentSocketName = "org.qemu.guest_agent.0";
 protected WatchDogAction _watchDogAction = WatchDogAction.NONE;
 protected WatchDogModel _watchDogModel = WatchDogModel.I6300ESB;
@@ -1308,7 +1309,7 @@ public class LibvirtComp

[cloudstack] branch master updated: server/test: Move test files to right location (#3085)

2018-12-07 Thread rohit
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 d36e1a6  server/test: Move test files to right location (#3085)
d36e1a6 is described below

commit d36e1a63a741c8c8b0376ba8b6fea765e689fe19
Author: Wido den Hollander 
AuthorDate: Fri Dec 7 18:12:52 2018 +0100

server/test: Move test files to right location (#3085)

These files were not in the right directory and thus not being executed
by Maven.

By moving the files we make sure these tests are run again.

Signed-off-by: Wido den Hollander 
---
 server/{test => src/test/java}/com/cloud/hypervisor/KVMGuruTest.java  | 0
 .../test/java}/com/cloud/network/guru/DirectNetworkGuruTest.java  | 0
 .../test/java}/com/cloud/resource/ResourceManagerImplTest.java| 0
 server/{test => src/test/java}/com/cloud/vm/UserVmManagerImplTest.java| 0
 .../org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImplTest.java| 0
 .../agent/lb/algorithm/IndirectAgentLBRoundRobinAlgorithmTest.java| 0
 .../agent/lb/algorithm/IndirectAgentLBShuffleAlgorithmTest.java   | 0
 .../cloudstack/agent/lb/algorithm/IndirectAgentLBStaticAlgorithmTest.java | 0
 8 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/server/test/com/cloud/hypervisor/KVMGuruTest.java 
b/server/src/test/java/com/cloud/hypervisor/KVMGuruTest.java
similarity index 100%
rename from server/test/com/cloud/hypervisor/KVMGuruTest.java
rename to server/src/test/java/com/cloud/hypervisor/KVMGuruTest.java
diff --git a/server/test/com/cloud/network/guru/DirectNetworkGuruTest.java 
b/server/src/test/java/com/cloud/network/guru/DirectNetworkGuruTest.java
similarity index 100%
rename from server/test/com/cloud/network/guru/DirectNetworkGuruTest.java
rename to server/src/test/java/com/cloud/network/guru/DirectNetworkGuruTest.java
diff --git a/server/test/com/cloud/resource/ResourceManagerImplTest.java 
b/server/src/test/java/com/cloud/resource/ResourceManagerImplTest.java
similarity index 100%
rename from server/test/com/cloud/resource/ResourceManagerImplTest.java
rename to server/src/test/java/com/cloud/resource/ResourceManagerImplTest.java
diff --git a/server/test/com/cloud/vm/UserVmManagerImplTest.java 
b/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java
similarity index 100%
rename from server/test/com/cloud/vm/UserVmManagerImplTest.java
rename to server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java
diff --git 
a/server/test/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImplTest.java
 
b/server/src/test/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImplTest.java
similarity index 100%
rename from 
server/test/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImplTest.java
rename to 
server/src/test/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImplTest.java
diff --git 
a/server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBRoundRobinAlgorithmTest.java
 
b/server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBRoundRobinAlgorithmTest.java
similarity index 100%
rename from 
server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBRoundRobinAlgorithmTest.java
rename to 
server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBRoundRobinAlgorithmTest.java
diff --git 
a/server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBShuffleAlgorithmTest.java
 
b/server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBShuffleAlgorithmTest.java
similarity index 100%
rename from 
server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBShuffleAlgorithmTest.java
rename to 
server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBShuffleAlgorithmTest.java
diff --git 
a/server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBStaticAlgorithmTest.java
 
b/server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBStaticAlgorithmTest.java
similarity index 100%
rename from 
server/test/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBStaticAlgorithmTest.java
rename to 
server/src/test/java/org/apache/cloudstack/agent/lb/algorithm/IndirectAgentLBStaticAlgorithmTest.java



[cloudstack] branch 4.11 updated: travis: fail fast if --with-marvin fails with nose (#3024)

2018-12-07 Thread rohit
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 408cce4  travis: fail fast if --with-marvin fails with nose (#3024)
408cce4 is described below

commit 408cce48a583ff907c1ad8bd349a385e8ee554ec
Author: Rohit Yadav 
AuthorDate: Fri Dec 7 23:45:19 2018 +0530

travis: fail fast if --with-marvin fails with nose (#3024)

* travis: fail fast if --with-marvin fails with nose

Install missing dependency pycrypto.
This fixes issue with recent Travis runs which gave incorrect results
around smoketests with simulator where each test run failed with an
error like "nosetests: error: no such option: --with-marvin".

Signed-off-by: Rohit Yadav 
---
 tools/travis/before_install.sh | 4 +---
 tools/travis/script.sh | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh
index d6fb25c..a084d38 100755
--- a/tools/travis/before_install.sh
+++ b/tools/travis/before_install.sh
@@ -98,11 +98,9 @@ echo "
 
 echo -e "\nInstalling some python packages: "
 
-pip install --user --upgrade pip
-
 for ((i=0;i<$RETRY_COUNT;i++))
 do
-  pip install --user --upgrade lxml paramiko nose texttable ipmisim pyopenssl 
mock flask netaddr pylint pycodestyle six astroid > /tmp/piplog
+  pip install --user --upgrade lxml paramiko nose texttable ipmisim pyopenssl 
pycrypto mock flask netaddr pylint pycodestyle six astroid > /tmp/piplog
   if [[ $? -eq 0 ]]; then
 echo -e "\npython packages installed successfully"
 break;
diff --git a/tools/travis/script.sh b/tools/travis/script.sh
index c370225..edf53ee 100755
--- a/tools/travis/script.sh
+++ b/tools/travis/script.sh
@@ -26,6 +26,8 @@ mkdir -p integration-test-results/component
 TESTS=($@)
 echo "Running tests: " ${TESTS[@]}
 
+set -e
+
 for suite in "${TESTS[@]}" ; do
   echo "Currently running test: $suite"
   nosetests --with-xunit --xunit-file=integration-test-results/$suite.xml 
--with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/$suite.py 
-s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator 
--hypervisor=simulator || true ;



[cloudstack] branch master updated (d36e1a6 -> ecd2b95)

2018-12-07 Thread rohit
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 d36e1a6  server/test: Move test files to right location (#3085)
 add 408cce4  travis: fail fast if --with-marvin fails with nose (#3024)
 new ecd2b95  Merge remote-tracking branch 'origin/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:
 tools/travis/before_install.sh | 4 +---
 tools/travis/script.sh | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)



[cloudstack] 01/01: Merge remote-tracking branch 'origin/4.11'

2018-12-07 Thread rohit
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 ecd2b95d492282d60107f5e132e39f0cd2d808c0
Merge: d36e1a6 408cce4
Author: Rohit Yadav 
AuthorDate: Fri Dec 7 23:46:04 2018 +0530

Merge remote-tracking branch 'origin/4.11'

 tools/travis/before_install.sh | 4 +---
 tools/travis/script.sh | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)



[cloudstack-cloudmonkey] branch master updated: config: Fixes #35 fix panic due to inappropriate config loading

2018-12-07 Thread rohit
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 dd613c3  config: Fixes #35 fix panic due to inappropriate config 
loading
dd613c3 is described below

commit dd613c303eab81b806f65f0c6f9062e8fce8ccd5
Author: Rohit Yadav 
AuthorDate: Sat Dec 8 03:20:38 2018 +0530

config: Fixes #35 fix panic due to inappropriate config loading

Signed-off-by: Rohit Yadav 
---
 cmk.go   |  2 +-
 config/config.go | 51 ---
 2 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/cmk.go b/cmk.go
index fad4f49..83e8b7e 100644
--- a/cmk.go
+++ b/cmk.go
@@ -63,7 +63,7 @@ func main() {
}
 
if *profile != "" {
-   cfg.UpdateConfig("profile", *profile, false)
+   cfg.LoadProfile(*profile)
}
 
cli.SetConfig(cfg)
diff --git a/config/config.go b/config/config.go
index f0eafad..56f7c37 100644
--- a/config/config.go
+++ b/config/config.go
@@ -28,8 +28,8 @@ import (
"time"
 
"github.com/gofrs/flock"
-   "github.com/mitchellh/go-homedir"
-   "gopkg.in/ini.v1"
+   homedir "github.com/mitchellh/go-homedir"
+   ini "gopkg.in/ini.v1"
 )
 
 // Output formats
@@ -150,6 +150,11 @@ func newHTTPClient(cfg *Config) *http.Client {
return client
 }
 
+func setActiveProfile(cfg *Config, profile *ServerProfile) {
+   cfg.ActiveProfile = profile
+   cfg.ActiveProfile.Client = newHTTPClient(cfg)
+}
+
 func reloadConfig(cfg *Config) *Config {
fileLock := flock.New(path.Join(getDefaultConfigDir(), "lock"))
err := fileLock.Lock()
@@ -162,6 +167,18 @@ func reloadConfig(cfg *Config) *Config {
return cfg
 }
 
+func readConfig(cfg *Config) *ini.File {
+   conf, err := ini.LoadSources(ini.LoadOptions{
+   IgnoreInlineComment: true,
+   }, cfg.ConfigFile)
+
+   if err != nil {
+   fmt.Printf("Fail to read config file: %v", err)
+   os.Exit(1)
+   }
+   return conf
+}
+
 func saveConfig(cfg *Config) *Config {
if _, err := os.Stat(cfg.Dir); err != nil {
os.Mkdir(cfg.Dir, 0700)
@@ -177,18 +194,10 @@ func saveConfig(cfg *Config) *Config {
conf.SaveTo(cfg.ConfigFile)
}
 
-   // Read config
-   conf, err := ini.LoadSources(ini.LoadOptions{
-   IgnoreInlineComment: true,
-   }, cfg.ConfigFile)
-
-   if err != nil {
-   fmt.Printf("Fail to read config file: %v", err)
-   os.Exit(1)
-   }
+   conf := readConfig(cfg)
 
core, err := conf.GetSection(ini.DEFAULT_SECTION)
-   if core == nil {
+   if core == nil || err != nil {
defaultCore := defaultCoreConfig()
section, _ := conf.NewSection(ini.DEFAULT_SECTION)
section.ReflectFrom(&defaultCore)
@@ -209,7 +218,7 @@ func saveConfig(cfg *Config) *Config {
activeProfile := defaultProfile()
section, _ := conf.NewSection(cfg.Core.ProfileName)
section.ReflectFrom(&activeProfile)
-   cfg.ActiveProfile = &activeProfile
+   setActiveProfile(cfg, &activeProfile)
} else {
// Write
if cfg.ActiveProfile != nil {
@@ -218,7 +227,7 @@ func saveConfig(cfg *Config) *Config {
// Update
profile := new(ServerProfile)
conf.Section(cfg.Core.ProfileName).MapTo(profile)
-   cfg.ActiveProfile = profile
+   setActiveProfile(cfg, profile)
}
// Save
conf.SaveTo(cfg.ConfigFile)
@@ -232,10 +241,22 @@ func saveConfig(cfg *Config) *Config {
profiles = append(profiles, profile.Name())
}
 
-   cfg.ActiveProfile.Client = newHTTPClient(cfg)
return cfg
 }
 
+// LoadProfile loads an existing profile
+func (c *Config) LoadProfile(name string) {
+   conf := readConfig(c)
+   section, err := conf.GetSection(name)
+   if err != nil || section == nil {
+   fmt.Printf("Unable to load profile '%s': %v", name, err)
+   os.Exit(1)
+   }
+   profile := new(ServerProfile)
+   conf.Section(name).MapTo(profile)
+   setActiveProfile(c, profile)
+}
+
 // UpdateConfig updates and saves config
 func (c *Config) UpdateConfig(key string, value string, update bool) {
switch key {



[cloudstack] branch 4.11 updated: api: don't throttle api discovery for listApis command (#2894)

2018-12-12 Thread rohit
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 8d53557  api: don't throttle api discovery for listApis command (#2894)
8d53557 is described below

commit 8d53557ba7167613df855635dd821c38ab4bf67e
Author: Craig Squire 
AuthorDate: Wed Dec 12 12:25:32 2018 -0600

api: don't throttle api discovery for listApis command (#2894)

Users reported that they weren't getting all apis listed in cloudmonkey 
when running a sync. After some debugging, I found that the problem is that the 
ApiDiscoveryService is calling ApiRateLimitServiceImpl.checkAccess(), so the 
results of the listApis command are being truncated because Cloudstack believes 
the user has exceeded their API throttling rate.

I enabled throttling with a 25 request per second limit. I then created a 
test role with only list* permissions and assigned it to a test user. When this 
user calls listApis, they will typically receive anywhere from 15-18 results. 
Checking the logs, you see The given user has reached his/her account api 
limit, please retry after 218 ms..

I raised the limit to 200 requests per second, restarted the management 
server and tried again. This time I got 143 results and no log messages about 
the user being throttled.
---
 .../org/apache/cloudstack/acl/APIAclChecker.java   | 23 ++
 ...ring-core-lifecycle-api-context-inheritable.xml |  5 +
 .../core/spring-core-registry-core-context.xml |  5 +
 .../acl/DynamicRoleBasedAPIAccessChecker.java  |  2 +-
 .../acl/StaticRoleBasedAPIAccessChecker.java   |  2 +-
 .../core/spring-server-core-misc-context.xml   |  2 +-
 6 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/api/src/org/apache/cloudstack/acl/APIAclChecker.java 
b/api/src/org/apache/cloudstack/acl/APIAclChecker.java
new file mode 100644
index 000..3a00f26
--- /dev/null
+++ b/api/src/org/apache/cloudstack/acl/APIAclChecker.java
@@ -0,0 +1,23 @@
+// 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.acl;
+
+/**
+ * Marker interface to differentiate ACL APICheckers from others (for example, 
a rate limit checker)
+ */
+public interface APIAclChecker extends APIChecker {
+}
diff --git 
a/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
 
b/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
index 7ab5523..655b7fe 100644
--- 
a/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
+++ 
b/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
@@ -51,6 +51,11 @@
 
 
 
+
+
+
+
+
 
 
 
diff --git 
a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml 
b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
index 1f70e52..2569d8b 100644
--- 
a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
+++ 
b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
@@ -264,6 +264,11 @@
 
class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
 
 
+
+
+
+
 
 
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 d10c191..d8612a6 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
@@ -36,7 +36,7 @@ import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.component.PluggableService;
 import com.google.common.base.Strings;
 
-public class DynamicRoleBasedAPIAccessChecker extends AdapterBase implements 
APIChecker {
+public class Dyna

[cloudstack-cloudmonkey] 02/04: output: Fix json output to not do html escape

2018-12-16 Thread rohit
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 224f4aa1fc29335479a37bdd92db7b3a9d687ff9
Author: Rohit Yadav 
AuthorDate: Sun Dec 16 02:22:03 2018 +0530

output: Fix json output to not do html escape

Also updates dependencies using `go mod vendor`.

Signed-off-by: Rohit Yadav 
---
 cmd/output.go  |  9 ++---
 go.mod |  2 +-
 go.sum |  2 +
 .../tablewriter/{LICENCE.md => LICENSE.md} |  2 +-
 vendor/github.com/pkg/term/termios/pty_bsd.go  | 46 ++
 .../term/termios/{pty_bsd.go => pty_freebsd.go}|  2 -
 vendor/github.com/pkg/term/termios/pty_netbsd.go   | 31 +++
 vendor/github.com/pkg/term/termios/termios_bsd.go  |  2 +-
 vendor/modules.txt |  2 +-
 9 files changed, 62 insertions(+), 36 deletions(-)

diff --git a/cmd/output.go b/cmd/output.go
index 2e649a3..04e9b9c 100644
--- a/cmd/output.go
+++ b/cmd/output.go
@@ -31,11 +31,10 @@ import (
 )
 
 func printJSON(response map[string]interface{}) {
-   jsonOutput, err := json.MarshalIndent(response, "", "  ")
-   if err != nil {
-   fmt.Println("Error during json marshalling:", err.Error())
-   }
-   fmt.Println(string(jsonOutput))
+   enc := json.NewEncoder(os.Stdout)
+   enc.SetEscapeHTML(false)
+   enc.SetIndent("", "  ")
+   enc.Encode(response)
 }
 
 func printTable(response map[string]interface{}) {
diff --git a/go.mod b/go.mod
index 40e9fe0..844a4a3 100644
--- a/go.mod
+++ b/go.mod
@@ -32,7 +32,7 @@ require (
github.com/mattn/go-tty v0.0.0-20181127064339-e4f871175a2f // indirect
github.com/mitchellh/go-homedir v1.0.0
github.com/olekukonko/tablewriter v0.0.1
-   github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 // indirect
+   github.com/pkg/term v0.0.0-20181116001808-27bbf2edb814 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d 
// indirect
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // 
indirect
golang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8 // indirect
diff --git a/go.sum b/go.sum
index 2a890b1..5c5a566 100644
--- a/go.sum
+++ b/go.sum
@@ -37,6 +37,8 @@ github.com/olekukonko/tablewriter v0.0.1 
h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8u
 github.com/olekukonko/tablewriter v0.0.1/go.mod 
h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
 github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 
h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ=
 github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod 
h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
+github.com/pkg/term v0.0.0-20181116001808-27bbf2edb814 
h1:qWlKm6sU/AyVAgBC1Pg1uuY/X/p4lNYG7t4v8/f4FJE=
+github.com/pkg/term v0.0.0-20181116001808-27bbf2edb814/go.mod 
h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d 
h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod 
h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
 github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a 
h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo=
diff --git a/vendor/github.com/olekukonko/tablewriter/LICENCE.md 
b/vendor/github.com/olekukonko/tablewriter/LICENSE.md
similarity index 98%
rename from vendor/github.com/olekukonko/tablewriter/LICENCE.md
rename to vendor/github.com/olekukonko/tablewriter/LICENSE.md
index 1fd8484..a0769b5 100644
--- a/vendor/github.com/olekukonko/tablewriter/LICENCE.md
+++ b/vendor/github.com/olekukonko/tablewriter/LICENSE.md
@@ -16,4 +16,4 @@ 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.
\ No newline at end of file
+THE SOFTWARE.
diff --git a/vendor/github.com/pkg/term/termios/pty_bsd.go 
b/vendor/github.com/pkg/term/termios/pty_bsd.go
index d1a3baf..45336d4 100644
--- a/vendor/github.com/pkg/term/termios/pty_bsd.go
+++ b/vendor/github.com/pkg/term/termios/pty_bsd.go
@@ -1,41 +1,37 @@
-// +build freebsd openbsd netbsd
+// +build dragonfly openbsd
 
 package termios
 
-import (
-   "fmt"
-   "syscall"
-   "unsafe"
-)
+// #include
+import "C"
 
-func posix_openpt(oflag int) (fd uintptr, err error) {
-   // Copied from debian-golang-pty/pty_freebsd.go.
-   r0, _, e1 := syscall.Syscall(syscall.SYS_POSIX_OPENPT, uintptr(oflag), 
0, 0)
-   fd = uintpt

[cloudstack-cloudmonkey] branch master updated (dd613c3 -> 1fe5674)

2018-12-16 Thread rohit
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 dd613c3  config: Fixes #35 fix panic due to inappropriate config 
loading
 new d2d2339  vendor: update dependencies
 new 224f4aa  output: Fix json output to not do html escape
 new 6d5c80d  history: ignore duplicate and empty inputs for shell history
 new 1fe5674  cmk: debug cmdline args input comma separated for readability

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/history.go |  7 ++
 cmd/output.go  |  9 +--
 cmk.go |  3 +-
 go.mod |  8 +-
 go.sum |  8 ++
 vendor/github.com/briandowns/spinner/README.md | 92 +++---
 vendor/github.com/briandowns/spinner/spinner.go|  3 +
 vendor/github.com/mattn/go-tty/tty_windows.go  |  7 +-
 .../tablewriter/{LICENCE.md => LICENSE.md} |  2 +-
 vendor/github.com/olekukonko/tablewriter/README.md |  2 +-
 vendor/github.com/olekukonko/tablewriter/table.go  |  4 +-
 vendor/github.com/pkg/term/termios/pty_bsd.go  | 46 +--
 .../term/termios/{pty_bsd.go => pty_freebsd.go}|  2 -
 vendor/github.com/pkg/term/termios/pty_netbsd.go   | 31 
 vendor/github.com/pkg/term/termios/termios_bsd.go  |  2 +-
 vendor/modules.txt |  8 +-
 16 files changed, 139 insertions(+), 95 deletions(-)
 rename vendor/github.com/olekukonko/tablewriter/{LICENCE.md => LICENSE.md} 
(98%)
 copy vendor/github.com/pkg/term/termios/{pty_bsd.go => pty_freebsd.go} (95%)
 create mode 100644 vendor/github.com/pkg/term/termios/pty_netbsd.go



[cloudstack-cloudmonkey] 03/04: history: ignore duplicate and empty inputs for shell history

2018-12-16 Thread rohit
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 6d5c80d1291763cc319c0096754781788c7d20e6
Author: Rohit Yadav 
AuthorDate: Sun Dec 16 03:18:11 2018 +0530

history: ignore duplicate and empty inputs for shell history

Signed-off-by: Rohit Yadav 
---
 cli/history.go | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/cli/history.go b/cli/history.go
index dd09553..8c71373 100644
--- a/cli/history.go
+++ b/cli/history.go
@@ -20,6 +20,7 @@ import (
"bufio"
"fmt"
"os"
+   "strings"
 )
 
 func initHistory() {
@@ -48,7 +49,12 @@ func readHistory() []string {
return lines
 }
 
+var lastInput string
+
 func writeHistory(in string) {
+   if len(strings.TrimSpace(in)) < 1 || in == lastInput {
+   return
+   }
file, err := os.OpenFile(cfg.HistoryFile, os.O_APPEND|os.O_WRONLY, 0600)
if err != nil {
fmt.Println("Failed to open history file:", err)
@@ -58,4 +64,5 @@ func writeHistory(in string) {
if _, err = file.WriteString(in + "\n"); err != nil {
fmt.Println("Failed to write history:", err)
}
+   lastInput = in
 }



[cloudstack-cloudmonkey] 01/04: vendor: update dependencies

2018-12-16 Thread rohit
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 d2d23392abc89d33a77ca79a27c5f9539f2388bd
Author: Rohit Yadav 
AuthorDate: Sun Dec 16 02:20:47 2018 +0530

vendor: update dependencies

Signed-off-by: Rohit Yadav 
---
 go.mod |  6 +-
 go.sum |  6 ++
 vendor/github.com/briandowns/spinner/README.md | 92 +++---
 vendor/github.com/briandowns/spinner/spinner.go|  3 +
 vendor/github.com/mattn/go-tty/tty_windows.go  |  7 +-
 vendor/github.com/olekukonko/tablewriter/README.md |  2 +-
 vendor/github.com/olekukonko/tablewriter/table.go  |  4 +-
 vendor/modules.txt |  6 +-
 8 files changed, 68 insertions(+), 58 deletions(-)

diff --git a/go.mod b/go.mod
index 99642a2..40e9fe0 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,7 @@
 module github.com/apache/cloudstack-cloudmonkey
 
 require (
-   github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20
+   github.com/briandowns/spinner v0.0.0-20181029155426-195c31b675a7
github.com/c-bata/go-prompt v0.2.3
github.com/fatih/color v1.7.0 // indirect
github.com/gofrs/flock v0.7.0
@@ -29,9 +29,9 @@ require (
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mattn/go-runewidth v0.0.3 // indirect
-   github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 // indirect
+   github.com/mattn/go-tty v0.0.0-20181127064339-e4f871175a2f // indirect
github.com/mitchellh/go-homedir v1.0.0
-   github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc
+   github.com/olekukonko/tablewriter v0.0.1
github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d 
// indirect
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // 
indirect
diff --git a/go.sum b/go.sum
index e19de37..2a890b1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,7 @@
 github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20 
h1:kWWOFAhyzkpi4/+L3++mYiZbuxh1TqYkDMHfFjk6ZfE=
 github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20/go.mod 
h1:hw/JEQBIE+c/BLI4aKM8UU8v+ZqrD3h7HC27kKt8JQU=
+github.com/briandowns/spinner v0.0.0-20181029155426-195c31b675a7 
h1:IvbBe4mOtBLz3X8n95FV5FzQqGWkrkCrfKdQxj7DkUg=
+github.com/briandowns/spinner v0.0.0-20181029155426-195c31b675a7/go.mod 
h1:hw/JEQBIE+c/BLI4aKM8UU8v+ZqrD3h7HC27kKt8JQU=
 github.com/c-bata/go-prompt v0.2.3 
h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2s=
 github.com/c-bata/go-prompt v0.2.3/go.mod 
h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
 github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
@@ -25,10 +27,14 @@ github.com/mattn/go-runewidth v0.0.3 
h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8Bz
 github.com/mattn/go-runewidth v0.0.3/go.mod 
h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 
h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U=
 github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod 
h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
+github.com/mattn/go-tty v0.0.0-20181127064339-e4f871175a2f 
h1:4P7Ul+TAnk92vTeVkXs6VLjmf1EhrYtDRa03PCYY6VM=
+github.com/mattn/go-tty v0.0.0-20181127064339-e4f871175a2f/go.mod 
h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
 github.com/mitchellh/go-homedir v1.0.0 
h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
 github.com/mitchellh/go-homedir v1.0.0/go.mod 
h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc 
h1:rQ1O4ZLYR2xXHXgBCCfIIGnuZ0lidMQw2S5n1oOv+Wg=
 github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod 
h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
+github.com/olekukonko/tablewriter v0.0.1 
h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
+github.com/olekukonko/tablewriter v0.0.1/go.mod 
h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
 github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 
h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ=
 github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod 
h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d 
h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
diff --git a/vendor/github.com/briandowns/spinner/README.md 
b/vendor/github.com/briandowns/spinner/README.md
index 214af8b..d23f4da 100644
--- a/vendor/github.com/briandowns/spinner/README.md
+++ b/vendor/github.com/briandowns/spinner/README.md
@@ -17,52 +17,52 @@ go get github.com/briandowns/spinner
 ## Available Character Sets
 (Numbered by their slice index)
 
-index | character set

[cloudstack-cloudmonkey] 04/04: cmk: debug cmdline args input comma separated for readability

2018-12-16 Thread rohit
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 1fe567482931100fc364d33218d2d6ae42f0d66a
Author: Rohit Yadav 
AuthorDate: Sun Dec 16 03:18:52 2018 +0530

cmk: debug cmdline args input comma separated for readability

Signed-off-by: Rohit Yadav 
---
 cmk.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmk.go b/cmk.go
index 83e8b7e..4f70cb5 100644
--- a/cmk.go
+++ b/cmk.go
@@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"os"
+   "strings"
 
"github.com/apache/cloudstack-cloudmonkey/cli"
"github.com/apache/cloudstack-cloudmonkey/cmd"
@@ -68,7 +69,7 @@ func main() {
 
cli.SetConfig(cfg)
args := flag.Args()
-   config.Debug("cmdline args:", os.Args)
+   config.Debug("cmdline args:", strings.Join(os.Args, ", "))
if len(args) > 0 {
if err := cli.ExecCmd(args); err != nil {
fmt.Println("🙈 Error:", err)



[cloudstack-cloudmonkey] branch readline-prompt created (now 74cef04)

2018-12-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch readline-prompt
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


  at 74cef04  cli: revert back to chzyer/readline

This branch includes the following new commits:

 new 74cef04  cli: revert back to chzyer/readline

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.




[cloudstack-cloudmonkey] branch readline-prompt updated: fix minor bug

2018-12-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch readline-prompt
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git


The following commit(s) were added to refs/heads/readline-prompt by this push:
 new 0a2abb1  fix minor bug
0a2abb1 is described below

commit 0a2abb192034bb675162a80cbb499427e771ef83
Author: Rohit Yadav 
AuthorDate: Mon Dec 17 00:59:09 2018 +0530

fix minor bug

Signed-off-by: Rohit Yadav 
---
 vendor/github.com/chzyer/readline/complete.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vendor/github.com/chzyer/readline/complete.go 
b/vendor/github.com/chzyer/readline/complete.go
index 7a6b73a..9d19fa5 100644
--- a/vendor/github.com/chzyer/readline/complete.go
+++ b/vendor/github.com/chzyer/readline/complete.go
@@ -47,7 +47,7 @@ func newOpCompleter(w io.Writer, op *Operation, width int) 
*opCompleter {
 }
 
 func (o *opCompleter) writeRunes(candidate []rune) {
-   lastIndex := 0
+   lastIndex := len(candidate)
for idx, r := range candidate {
if r == '(' {
lastIndex = idx



[cloudstack] branch master updated: README: Ho ho ho! (#3102)

2018-12-20 Thread rohit
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 5067d56  README: Ho ho ho! (#3102)
5067d56 is described below

commit 5067d560ce4c0084a58f08f5db4cc92a97e166d9
Author: Rohit Yadav 
AuthorDate: Thu Dec 20 16:47:38 2018 +0530

README: Ho ho ho! (#3102)

Happy holidays - Merry Christmas and new year!
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 471672f..7b36711 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Apache CloudStack [![Build 
Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack)
 [![Coverity Scan Build 
Status](https://scan.coverity.com/projects/943/badge.svg)](https://scan.coverity.com/projects/943)
 
-![Apache CloudStack](tools/logo/apache_cloudstack.png)
+![Apache CloudStack](tools/logo/acsxmas.jpg)
 
 Apache CloudStack is open source software designed to deploy and manage large
 networks of virtual machines, as a highly available, highly scalable



[cloudstack] branch 4.11 updated: api: allow keyword search in listSSHKeyPairs (#2920) (#3098)

2018-12-22 Thread rohit
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 a7ccbdc  api: allow keyword search in listSSHKeyPairs (#2920) (#3098)
a7ccbdc is described below

commit a7ccbdc79084b56d2a32a3ecd14d5ffed2b9a811
Author: Anurag Awasthi <43956255+anura...@users.noreply.github.com>
AuthorDate: Sun Dec 23 00:34:53 2018 +0530

api: allow keyword search in listSSHKeyPairs (#2920) (#3098)

Adds support for keyword search that was ignored by listsshkeypairs command.

Fixes: #2920
---
 server/src/com/cloud/server/ManagementServerImpl.java | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/server/src/com/cloud/server/ManagementServerImpl.java 
b/server/src/com/cloud/server/ManagementServerImpl.java
index 56c912d..38a84bb 100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -3655,6 +3655,7 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
 public Pair, Integer> listSSHKeyPairs(final 
ListSSHKeyPairsCmd cmd) {
 final String name = cmd.getName();
 final String fingerPrint = cmd.getFingerprint();
+final String keyword = cmd.getKeyword();
 
 final Account caller = getCaller();
 final List permittedAccounts = new ArrayList();
@@ -3681,6 +3682,11 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
 sc.addAnd("fingerprint", SearchCriteria.Op.EQ, fingerPrint);
 }
 
+if (keyword != null) {
+sc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
+sc.addOr("fingerprint", SearchCriteria.Op.LIKE, "%" + keyword + 
"%");
+}
+
 final Pair, Integer> result = 
_sshKeyPairDao.searchAndCount(sc, searchFilter);
 return new Pair, Integer>(result.first(), 
result.second());
 }



[cloudstack-cloudmonkey] branch readline-prompt updated (0a2abb1 -> f0a495b)

2018-12-23 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch readline-prompt
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


from 0a2abb1  fix minor bug
 add f0a495b  heuristics based api param completion

No new revisions were added by this update.

Summary of changes:
 cli/completer.go | 45 +
 config/about.go  |  2 +-
 2 files changed, 38 insertions(+), 9 deletions(-)



[cloudstack] branch master updated: server: Enhance bypass vlan overlap check (#3026)

2018-12-23 Thread rohit
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 cabef53  server: Enhance bypass vlan overlap check (#3026)
cabef53 is described below

commit cabef5305d350869cfa62a542cc74ae95addfecc
Author: Gerd Müller 
AuthorDate: Mon Dec 24 08:16:54 2018 +0100

server: Enhance bypass vlan overlap check (#3026)

This PR adds the possibility to select a checkbox for the parameter 
bypassvlanoverlapcheck to the ajax request createNetwork. The checkbox was 
added for Guest Network as well as for the L2 Guest Network. For L2 Guest 
Network a backend check for the existence of the flag bypassvlanoverlapcheck 
was added.
---
 .../admin/network/CreateNetworkCmdByAdmin.java   |  2 +-
 .../engine/orchestration/NetworkOrchestrator.java| 13 +++--
 ui/l10n/en.js|  1 +
 ui/scripts/sharedFunctions.js| 20 ++--
 4 files changed, 31 insertions(+), 5 deletions(-)

diff --git 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
index 6d346e9..2dfd749 100644
--- 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
+++ 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
@@ -40,7 +40,7 @@ public class CreateNetworkCmdByAdmin extends CreateNetworkCmd 
{
 @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, 
description="the ID or VID of the network")
 private String vlan;
 
-@Parameter(name=ApiConstants.BYPASS_VLAN_OVERLAP_CHECK, 
type=CommandType.BOOLEAN, description="when true bypasses VLAN id/range overlap 
check during network creation for shared networks")
+@Parameter(name=ApiConstants.BYPASS_VLAN_OVERLAP_CHECK, 
type=CommandType.BOOLEAN, description="when true bypasses VLAN id/range overlap 
check during network creation for shared and L2 networks")
 private Boolean bypassVlanOverlapCheck;
 
 /
diff --git 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index c4db7dc..f223eb3 100644
--- 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2281,7 +2281,7 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
 }
 if (! UuidUtils.validateUUID(vlanId)){
 // For Isolated and L2 networks, don't allow to create network 
with vlan that already exists in the zone
-if (ntwkOff.getGuestType() == GuestType.Isolated || 
ntwkOff.getGuestType() == GuestType.L2) {
+if (ntwkOff.getGuestType() == GuestType.Isolated || 
!hasGuestBypassVlanOverlapCheck(bypassVlanOverlapCheck, ntwkOff)) {
 if (_networksDao.listByZoneAndUriAndGuestType(zoneId, 
uri.toString(), null).size() > 0) {
 throw new InvalidParameterValueException("Network with 
vlan " + vlanId + " already exists or overlaps with other network vlans in zone 
" + zoneId);
 } else {
@@ -2469,7 +2469,16 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
 return network;
 }
 
-/**
+  /**
+   * Checks bypass VLAN id/range overlap check during network creation for 
guest networks
+   * @param bypassVlanOverlapCheck bypass VLAN id/range overlap check
+   * @param ntwkOff network offering
+   */
+  private boolean hasGuestBypassVlanOverlapCheck(final boolean 
bypassVlanOverlapCheck, final NetworkOfferingVO ntwkOff) {
+return bypassVlanOverlapCheck && ntwkOff.getGuestType() != 
GuestType.Isolated;
+  }
+
+  /**
  * Checks for L2 network offering services. Only 2 cases allowed:
  * - No services
  * - User Data service only, provided by ConfigDrive
diff --git a/ui/l10n/en.js b/ui/l10n/en.js
index e20d609..46b9244 100644
--- a/ui/l10n/en.js
+++ b/ui/l10n/en.js
@@ -511,6 +511,7 @@ var dictionary = {
 "label.by.type":"By Type",
 "label.by.type.id":"By Type ID",
 "label.by.zone":"By Zone",
+"label.bypass.vlan.overlap.check": "Bypass VLAN id/range overlap",
 "label.bytes.received":"Bytes Received",
 "label.bytes.sent":"Bytes Sent",
 "label.cache.mode":

[cloudstack] branch master updated: network: Send userdata to Virtual Router if IPv6 is enabled (#3100)

2018-12-24 Thread rohit
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 2699586  network: Send userdata to Virtual Router if IPv6 is enabled 
(#3100)
2699586 is described below

commit 2699586d92c79017b8de09b0ad888f103b7d72f0
Author: Wido den Hollander 
AuthorDate: Mon Dec 24 19:12:57 2018 +0100

network: Send userdata to Virtual Router if IPv6 is enabled (#3100)

There is no reason to not send userdata+password to the VR as all
Instances in CloudStack are Dual-Stacked. They have IPv4 and IPv6
so they can query their metadata over IPv4 at the VR.

Signed-off-by: Wido den Hollander 
---
 .../network/element/VirtualRouterElement.java  |  5 --
 .../network/element/VirtualRouterElementTest.java  | 56 ++
 2 files changed, 56 insertions(+), 5 deletions(-)

diff --git 
a/server/src/main/java/com/cloud/network/element/VirtualRouterElement.java 
b/server/src/main/java/com/cloud/network/element/VirtualRouterElement.java
index 1a72877..862ccfe 100644
--- a/server/src/main/java/com/cloud/network/element/VirtualRouterElement.java
+++ b/server/src/main/java/com/cloud/network/element/VirtualRouterElement.java
@@ -1022,11 +1022,6 @@ NetworkMigrationResponder, AggregatedCommandExecutor, 
RedundantResource, DnsServ
 return false;
 }
 
-if (network.getIp6Gateway() != null) {
-s_logger.info("Skip password and userdata service setup for 
IPv6 VM");
-return true;
-}
-
 final VirtualMachineProfile uservm = vm;
 
 final List routers = getRouters(network, dest);
diff --git 
a/server/src/test/java/com/cloud/network/element/VirtualRouterElementTest.java 
b/server/src/test/java/com/cloud/network/element/VirtualRouterElementTest.java
index 4fbc28e..2d66ea7 100644
--- 
a/server/src/test/java/com/cloud/network/element/VirtualRouterElementTest.java
+++ 
b/server/src/test/java/com/cloud/network/element/VirtualRouterElementTest.java
@@ -449,4 +449,60 @@ public class VirtualRouterElementTest {
 when(_routerDao.persist(any(DomainRouterVO.class))).thenReturn(router);
 }
 
+@Test
+public void testCanHandle() {
+Network network = Mockito.mock(Network.class);
+
+final long networkId = 1;
+final long physicalNetworkId = 42;
+final long networkOfferingId = 10;
+final long dataCenterId = 33;
+
+when(network.getId()).thenReturn(networkId);
+when(network.getPhysicalNetworkId()).thenReturn(physicalNetworkId);
+when(network.getTrafficType()).thenReturn(TrafficType.Guest);
+when(network.getNetworkOfferingId()).thenReturn(networkOfferingId);
+when(network.getDataCenterId()).thenReturn(dataCenterId);
+when(network.getVpcId()).thenReturn(null);
+
+
when(virtualRouterElement._networkMdl.getPhysicalNetworkId(network)).thenReturn(physicalNetworkId);
+
when(virtualRouterElement._networkMdl.isProviderEnabledInPhysicalNetwork(physicalNetworkId,
 Network.Provider.VirtualRouter.getName())).thenReturn(true);
+
when(virtualRouterElement._networkMdl.isProviderForNetwork(Network.Provider.VirtualRouter,
 networkId)).thenReturn(true);
+
+assertTrue(virtualRouterElement.canHandle(network, null));
+}
+
+@Test
+public void testAddPasswordAndUserdata() throws Exception {
+Network network = Mockito.mock(Network.class);
+VirtualMachineProfile vm = Mockito.mock(VirtualMachineProfile.class);
+NicProfile nic = Mockito.mock(NicProfile.class);
+DeployDestination dest = Mockito.mock(DeployDestination.class);
+ReservationContext context = Mockito.mock(ReservationContext.class);
+Service service = Service.UserData;
+
+final long networkId = 1;
+final long physicalNetworkId = 42;
+final long networkOfferingId = 10;
+final long dataCenterId = 33;
+
+when(network.getId()).thenReturn(networkId);
+when(network.getPhysicalNetworkId()).thenReturn(physicalNetworkId);
+when(network.getTrafficType()).thenReturn(TrafficType.Guest);
+when(network.getNetworkOfferingId()).thenReturn(networkOfferingId);
+when(network.getDataCenterId()).thenReturn(dataCenterId);
+when(network.getVpcId()).thenReturn(null);
+
+when(vm.getType()).thenReturn(VirtualMachine.Type.User);
+
+
when(virtualRouterElement._networkMdl.getPhysicalNetworkId(network)).thenReturn(physicalNetworkId);
+
when(virtualRouterElement._networkMdl.isProviderEnabledInPhysicalNetwork(physicalNetworkId,
 Network.Provider.VirtualRouter.getName())).thenReturn(true);
+
when(virtualRouterElement._networkMdl.isProviderSupportServiceInNetwork(networkId,
 service, Network.Provider.VirtualRouter)).

[cloudstack] branch 4.11 updated: marvin: add missing test data for test_migration smoketest (#3106)

2018-12-24 Thread rohit
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 68b4b84  marvin: add missing test data for test_migration smoketest 
(#3106)
68b4b84 is described below

commit 68b4b8410138a1a16337ff15ac6260e0ecae9bc0
Author: Rohit Yadav 
AuthorDate: Mon Dec 24 23:43:57 2018 +0530

marvin: add missing test data for test_migration smoketest (#3106)

Add missing test data for test_migration smoketest, use test_template for 
smoketest.

Signed-off-by: Rohit Yadav 
---
 test/integration/smoke/test_service_offerings.py | 10 +-
 tools/marvin/marvin/config/test_data.py  | 20 
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/test/integration/smoke/test_service_offerings.py 
b/test/integration/smoke/test_service_offerings.py
index 9d05a7a..9d4650b 100644
--- a/test/integration/smoke/test_service_offerings.py
+++ b/test/integration/smoke/test_service_offerings.py
@@ -31,7 +31,7 @@ from marvin.lib.common import (list_service_offering,
list_virtual_machines,
get_domain,
get_zone,
-   get_template,
+   get_test_template,
list_hosts)
 from nose.plugins.attrib import attr
 
@@ -167,13 +167,13 @@ class TestServiceOfferings(cloudstackTestCase):
 cls.apiclient,
 cls.services["service_offerings"]["tiny"]
 )
-template = get_template(
+template = get_test_template(
 cls.apiclient,
 cls.zone.id,
 cls.hypervisor
 )
 if template == FAILED:
-assert False, "get_template() failed to return template"
+assert False, "get_test_template() failed to return template"
 
 # Set Zones and disk offerings
 cls.services["small"]["zoneid"] = cls.zone.id
@@ -458,9 +458,9 @@ class TestCpuCapServiceOfferings(cloudstackTestCase):
 cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
 cls.services['mode'] = cls.zone.networktype
 
-template = get_template(cls.apiclient, cls.zone.id, cls.hypervisor)
+template = get_test_template(cls.apiclient, cls.zone.id, 
cls.hypervisor)
 if template == FAILED:
-assert False, "get_template() failed to return template"
+assert False, "get_test_template() failed to return template"
 
 cls.services["small"]["zoneid"] = cls.zone.id
 cls.services["small"]["template"] = template.id
diff --git a/tools/marvin/marvin/config/test_data.py 
b/tools/marvin/marvin/config/test_data.py
index b8ebcb6..7c5ce5c 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -644,6 +644,26 @@ test_data = {
 "Lb": "VpcVirtualRouter"
 }
 },
+"nw_offering_reduced_vpc": {
+"name": 'Reduced Network for VPC',
+"displaytext": 'Reduced Network for VPC',
+"guestiptype": 'Isolated',
+"supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,UserData,'
+ 'Dns',
+"traffictype": 'GUEST',
+"availability": 'Optional',
+"tags": "native",
+"useVpc": 'on',
+"ispersistent": 'True',
+"serviceProviderList": {
+"Dhcp": "VpcVirtualRouter",
+"StaticNat": "VpcVirtualRouter",
+"SourceNat": "VpcVirtualRouter",
+"NetworkACL": "VpcVirtualRouter",
+"UserData": "VpcVirtualRouter",
+"Dns": "VpcVirtualRouter"
+}
+},
 "nw_off_persistent_VPCVR_LB": {
 "name": "Persistent Network VPC with LB",
 "displaytext": "Persistent Network VPC No LB",



[cloudstack] branch master updated (2699586 -> 3279707)

2018-12-24 Thread rohit
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 2699586  network: Send userdata to Virtual Router if IPv6 is enabled 
(#3100)
 add 3279707  api: Throw InvalidParameterValueException for failing 
ApiArgValidator (#3108)

No new revisions were added by this update.

Summary of changes:
 .../java/com/cloud/api/dispatch/ParamProcessWorker.java | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)



[cloudstack] branch master updated (3279707 -> 3424d9e)

2018-12-28 Thread rohit
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 3279707  api: Throw InvalidParameterValueException for failing 
ApiArgValidator (#3108)
 add 8d53557  api: don't throttle api discovery for listApis command (#2894)
 add a7ccbdc  api: allow keyword search in listSSHKeyPairs (#2920) (#3098)
 add 68b4b84  marvin: add missing test data for test_migration smoketest 
(#3106)
 new 3424d9e  Merge remote-tracking branch 'origin/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:
 .../apache/cloudstack/acl/APIAclChecker.java}|  5 -
 ...spring-core-lifecycle-api-context-inheritable.xml |  5 +
 .../core/spring-core-registry-core-context.xml   |  5 +
 .../acl/DynamicRoleBasedAPIAccessChecker.java|  2 +-
 .../acl/StaticRoleBasedAPIAccessChecker.java |  2 +-
 .../java/com/cloud/server/ManagementServerImpl.java  |  6 ++
 .../core/spring-server-core-misc-context.xml |  2 +-
 test/integration/smoke/test_service_offerings.py | 10 +-
 tools/marvin/marvin/config/test_data.py  | 20 
 9 files changed, 48 insertions(+), 9 deletions(-)
 copy api/src/{main/java/org/apache/cloudstack/acl/InfrastructureEntity.java => 
org/apache/cloudstack/acl/APIAclChecker.java} (83%)



[cloudstack] branch 4.11 updated: server: Prevent corner case for infinite PrepareForMaintenance (#3095)

2018-12-28 Thread rohit
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 13c81a8  server: Prevent corner case for infinite 
PrepareForMaintenance (#3095)
13c81a8 is described below

commit 13c81a8ee441e239fb4afe98b5b3da4455fe6459
Author: Nicolas Vazquez 
AuthorDate: Fri Dec 28 06:44:16 2018 -0300

server: Prevent corner case for infinite PrepareForMaintenance (#3095)

A corner case was found on 4.11.2 for #2493 leading to an infinite loop in 
state PrepareForMaintenance

To prevent such cases, in which failed migrations are detected but still 
running on the host, this feature adds a new cluster setting 
host.maintenance.retries which is the number of retries before marking the host 
as ErrorInMaintenance if migration errors persist.

How Has This Been Tested?
- 2 KVM hosts, pick one which has running VMs as H
- Block migrations ports on H to simulate failures on migrations:
iptables -I OUTPUT -j REJECT -m state --state NEW -m tcp -p tcp --dport 
49152:49215 -m comment --comment 'test block migrations' iptables -I OUTPUT -j 
REJECT -m state --state NEW -m tcp -p tcp --dport 16509 -m comment --comment 
'test block migrations
- Put host H in Maintenance
- Observe that host is indefinitely in PrepareForMaintenance state (after 
this fix it goes into ErrorInMaintenance after retrying 
host.maintenance.retries times)
---
 .../src/com/cloud/resource/ResourceManager.java| 10 +-
 .../com/cloud/resource/ResourceManagerImpl.java| 41 ++
 .../cloud/resource/MockResourceManagerImpl.java| 11 ++
 .../cloud/resource/ResourceManagerImplTest.java| 18 ++
 4 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/engine/components-api/src/com/cloud/resource/ResourceManager.java 
b/engine/components-api/src/com/cloud/resource/ResourceManager.java
index 1f7d3cb..720a980 100755
--- a/engine/components-api/src/com/cloud/resource/ResourceManager.java
+++ b/engine/components-api/src/com/cloud/resource/ResourceManager.java
@@ -38,12 +38,20 @@ import com.cloud.host.Status;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ResourceState.Event;
 import com.cloud.utils.fsm.NoTransitionException;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
 
 /**
  * ResourceManager manages how physical resources are organized within the
  * CloudStack. It also manages the life cycle of the physical resources.
  */
-public interface ResourceManager extends ResourceService {
+public interface ResourceManager extends ResourceService, Configurable {
+
+ConfigKey HostMaintenanceRetries = new ConfigKey<>("Advanced", 
Integer.class,
+"host.maintenance.retries","20",
+"Number of retries when preparing a host into Maintenance Mode is 
faulty before failing",
+true, ConfigKey.Scope.Cluster);
+
 /**
  * Register a listener for different types of resource life cycle events.
  * There can only be one type of listener per type of host.
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java 
b/server/src/com/cloud/resource/ResourceManagerImpl.java
index ba3c157..59a7fa8 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -26,11 +26,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import com.cloud.vm.dao.UserVmDetailsDao;
+import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
@@ -271,6 +273,8 @@ public class ResourceManagerImpl extends ManagerBase 
implements ResourceManager,
 
 private SearchBuilder _gpuAvailability;
 
+private Map retryHostMaintenance = new ConcurrentHashMap<>();
+
 private void insertListener(final Integer event, final ResourceListener 
listener) {
 List lst = _lifeCycleListeners.get(event);
 if (lst == null) {
@@ -1224,6 +1228,7 @@ public class ResourceManagerImpl extends ManagerBase 
implements ResourceManager,
 
 
ActionEventUtils.onStartedActionEvent(CallContext.current().getCallingUserId(), 
CallContext.current().getCallingAccountId(), 
EventTypes.EVENT_MAINTENANCE_PREPARE, "starting maintenance for host " + 
hostId, true, 0);
 _agentMgr.pullAgentToMaintenance(hostId);
+setHostMaintenanceRetries(host);
 
 /* TODO: move below to listener */
 if (host.getType() ==

[cloudstack] 01/01: Merge remote-tracking branch 'origin/4.11'

2018-12-28 Thread rohit
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 92cc4514eae9f5f9c24ec3a2befb1c23ae5d6f28
Merge: 3424d9e 13c81a8
Author: Rohit Yadav 
AuthorDate: Fri Dec 28 15:20:23 2018 +0530

Merge remote-tracking branch 'origin/4.11'

Signed-off-by: Rohit Yadav 

 .../java/com/cloud/resource/ResourceManager.java   | 10 -
 .../com/cloud/resource/ResourceManagerImpl.java| 49 --
 .../cloud/resource/MockResourceManagerImpl.java| 11 +
 .../cloud/resource/ResourceManagerImplTest.java| 18 
 4 files changed, 84 insertions(+), 4 deletions(-)

diff --cc server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
index 61b7ebf,000..8bc97cb
mode 100755,00..100755
--- a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
@@@ -1,2911 -1,0 +1,2954 @@@
 +// 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.resource;
 +
 +import java.net.URI;
 +import java.net.URISyntaxException;
 +import java.net.URLDecoder;
 +import java.util.ArrayList;
 +import java.util.Collections;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Random;
++import java.util.concurrent.ConcurrentHashMap;
 +
 +import javax.inject.Inject;
 +import javax.naming.ConfigurationException;
 +
 +import com.cloud.vm.dao.UserVmDetailsDao;
++import org.apache.cloudstack.framework.config.ConfigKey;
++import org.apache.commons.lang.ObjectUtils;
++import org.apache.log4j.Logger;
++import org.springframework.stereotype.Component;
++
 +import org.apache.cloudstack.api.ApiConstants;
 +import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
 +import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
 +import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
 +import org.apache.cloudstack.api.command.admin.host.AddSecondaryStorageCmd;
 +import org.apache.cloudstack.api.command.admin.host.CancelMaintenanceCmd;
 +import org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd;
 +import org.apache.cloudstack.api.command.admin.host.ReconnectHostCmd;
 +import org.apache.cloudstack.api.command.admin.host.UpdateHostCmd;
 +import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;
 +import org.apache.cloudstack.context.CallContext;
 +import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 +import org.apache.cloudstack.utils.identity.ManagementServerNode;
 +import org.apache.commons.collections.CollectionUtils;
- import org.apache.commons.lang.ObjectUtils;
- import org.apache.log4j.Logger;
- import org.springframework.stereotype.Component;
 +
 +import com.cloud.agent.AgentManager;
 +import com.cloud.agent.api.Answer;
 +import com.cloud.agent.api.Command;
 +import com.cloud.agent.api.GetVncPortCommand;
 +import com.cloud.agent.api.GetVncPortAnswer;
 +import com.cloud.agent.api.GetGPUStatsAnswer;
 +import com.cloud.agent.api.GetGPUStatsCommand;
 +import com.cloud.agent.api.GetHostStatsAnswer;
 +import com.cloud.agent.api.GetHostStatsCommand;
 +import com.cloud.agent.api.MaintainAnswer;
 +import com.cloud.agent.api.MaintainCommand;
 +import com.cloud.agent.api.PropagateResourceEventCommand;
 +import com.cloud.agent.api.StartupCommand;
 +import com.cloud.agent.api.StartupRoutingCommand;
 +import com.cloud.agent.api.UnsupportedAnswer;
 +import com.cloud.agent.api.UpdateHostPasswordCommand;
 +import com.cloud.agent.api.VgpuTypesInfo;
 +import com.cloud.agent.api.to.GPUDeviceTO;
 +import com.cloud.agent.transport.Request;
 +import com.cloud.capacity.Capacity;
 +import com.cloud.capacity.CapacityManager;
 +import com.cloud.capacity.CapacityState;
 +import com.cloud.capacity.CapacityVO;
 +import com.cloud.capacity.dao.CapacityDao;
 +import com.cloud.cluster.ClusterManager;
 +import com.cloud.

[cloudstack] branch master updated (3424d9e -> 92cc451)

2018-12-28 Thread rohit
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 3424d9e  Merge remote-tracking branch 'origin/4.11'
 add 13c81a8  server: Prevent corner case for infinite 
PrepareForMaintenance (#3095)
 new 92cc451  Merge remote-tracking branch 'origin/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/resource/ResourceManager.java   | 10 -
 .../com/cloud/resource/ResourceManagerImpl.java| 49 --
 .../cloud/resource/MockResourceManagerImpl.java| 11 +
 .../cloud/resource/ResourceManagerImplTest.java| 18 
 4 files changed, 84 insertions(+), 4 deletions(-)



[cloudstack] branch master updated: api: Fix forward merge path issue for APIAclChecker

2018-12-28 Thread rohit
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 bf4a91f  api: Fix forward merge path issue for APIAclChecker
bf4a91f is described below

commit bf4a91fce6a094c32718cbcafd8cf25c591f003b
Author: Rohit Yadav 
AuthorDate: Fri Dec 28 16:49:22 2018 +0530

api: Fix forward merge path issue for APIAclChecker

This moves the APIAclChecker class to the src/main/java directory.

Signed-off-by: Rohit Yadav 
---
 api/src/{ => main/java}/org/apache/cloudstack/acl/APIAclChecker.java | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/api/src/org/apache/cloudstack/acl/APIAclChecker.java 
b/api/src/main/java/org/apache/cloudstack/acl/APIAclChecker.java
similarity index 100%
rename from api/src/org/apache/cloudstack/acl/APIAclChecker.java
rename to api/src/main/java/org/apache/cloudstack/acl/APIAclChecker.java



[cloudstack-cloudmonkey] branch readline-prompt updated (f0a495b -> 2b8d070)

2018-12-29 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch readline-prompt
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


from f0a495b  heuristics based api param completion
 add 2b8d070  fix autocompletion for api args and filterargs

No new revisions were added by this update.

Summary of changes:
 cli/completer.go | 175 +++
 config/cache.go  |   3 +-
 2 files changed, 100 insertions(+), 78 deletions(-)



[cloudstack-cloudmonkey] tag 6.0.0-testing-beta2 deleted (was a8beed7)

2018-12-29 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag 6.0.0-testing-beta2
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


*** WARNING: tag 6.0.0-testing-beta2 was deleted! ***

 was a8beed7  network: fix segfault

The revisions that were on this tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack-cloudmonkey] tag 6.0.0-testing-beta3 created (now 3e9af96)

2018-12-29 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag 6.0.0-testing-beta3
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.


  at 3e9af96  (commit)
No new revisions were added by this update.



[cloudstack-cloudmonkey] branch master updated: cli: in case of no possible arg values, return empty string

2018-12-31 Thread rohit
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 c1185a5  cli: in case of no possible arg values, return empty string
c1185a5 is described below

commit c1185a511d60c80b445ade4d863dddf476dfe683
Author: Rohit Yadav 
AuthorDate: Mon Dec 31 18:37:41 2018 +0530

cli: in case of no possible arg values, return empty string

Signed-off-by: Rohit Yadav 
---
 cli/completer.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cli/completer.go b/cli/completer.go
index 8a161fa..3c7c5b9 100644
--- a/cli/completer.go
+++ b/cli/completer.go
@@ -352,6 +352,9 @@ func (t *autoCompleter) Do(line []rune, pos int) (options 
[][]rune, offset int)
}
}
offset = 0
+   if len(filteredOptions) == 0 {
+   options = [][]rune{[]rune("")}
+   }
for _, item := range filteredOptions {
option := item.Value + " "
if len(filteredOptions) > 1 && len(item.Detail) 
> 0 {



[cloudstack] branch master updated: api: Add api arg validator for createProject api (#3097) (#3107)

2018-12-31 Thread rohit
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 1ae2b6f  api: Add api arg validator for createProject api (#3097) 
(#3107)
1ae2b6f is described below

commit 1ae2b6fe203794cfd414cce8f72b981d926450cf
Author: Anurag Awasthi <43956255+anura...@users.noreply.github.com>
AuthorDate: Tue Jan 1 00:44:08 2019 +0530

api: Add api arg validator for createProject api (#3097) (#3107)

Create project command should have an API arg validator.

Fixes: #3097
---
 .../apache/cloudstack/api/command/user/project/CreateProjectCmd.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
 
b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
index e8a045c..79e372e 100644
--- 
a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
+++ 
b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
+import org.apache.cloudstack.api.ApiArgValidator;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
@@ -51,10 +52,10 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
entityType = DomainResponse.class, description = "domain ID of the account 
owning a project")
 private Long domainId;
 
-@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = 
true, description = "name of the project")
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = 
true, validations = ApiArgValidator.NotNullOrEmpty, description = "name of the 
project")
 private String name;
 
-@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, 
required = true, description = "display text of the project")
+@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, 
required = true, validations = ApiArgValidator.NotNullOrEmpty, description = 
"display text of the project")
 private String displayText;
 
 // ///



[cloudstack] branch 4.11 updated: vmware: syncVolumeToRootFolder method to avoid an infite recursive loop (#3105)

2019-01-07 Thread rohit
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 e56c499  vmware: syncVolumeToRootFolder method to avoid an infite 
recursive loop (#3105)
e56c499 is described below

commit e56c499fb837363387184cdbc4a137945303a4ad
Author: Dingane Hlaluku 
AuthorDate: Mon Jan 7 10:29:45 2019 +0200

vmware: syncVolumeToRootFolder method to avoid an infite recursive loop 
(#3105)

The static method syncVolumeToRootFolder() from 
VmwareStorageLayoutHelper.java:146 has been incorrectly called and leads to an 
infinite recursive call that ends up in a StackOverflowError. This PR fixes 
this.
public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO 
ds, String vmdkName, String vmName) throws Exception { 
syncVolumeToRootFolder(dcMo, ds, vmdkName, null); } -> public static void 
syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO ds, String vmdkName, 
String vmName) throws Exception { syncVolumeToRootFolder(dcMo, ds, vmdkName, 
vmName, null); }
---
 .../src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
index fc79a4b..9b2acbc 100644
--- 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
@@ -143,7 +143,7 @@ public class VmwareStorageLayoutHelper {
 }
 
 public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO 
ds, String vmdkName, String vmName) throws Exception {
-syncVolumeToRootFolder(dcMo, ds, vmdkName, null);
+syncVolumeToRootFolder(dcMo, ds, vmdkName, vmName, null);
 }
 
 public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO 
ds, String vmdkName, String vmName, String excludeFolders) throws Exception {



[cloudstack] tag brphase2-rc3 deleted (was c5142ca)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag brphase2-rc3
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag brphase2-rc3 was deleted! ***

 was c5142ca  Add error cause on exception

This change permanently discards the following revisions:

 discard c5142ca  Add error cause on exception
 discard 7da1799  detect volume including removed, for target VM don't search 
removed VM



[cloudstack] tag brphase2-rc1 deleted (was 240ff82)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag brphase2-rc1
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag brphase2-rc1 was deleted! ***

 was 240ff82  make API args consistent with arg/types

This change permanently discards the following revisions:

 discard 240ff82  make API args consistent with arg/types
 discard 660cfa7  Improvements and refactors
 discard 8833ddd  phase2: fix build/dependency issues with winrm
 discard b62eacb  B&R: Phase 2 commits melded
 discard 2fc49eb  b&r: phase1 all commits melded



[cloudstack] tag brphase2-rc2 deleted (was c76c290)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag brphase2-rc2
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag brphase2-rc2 was deleted! ***

 was c76c290  Fix CE-298

This change permanently discards the following revisions:

 discard c76c290  Fix CE-298
 discard 3abc3b8  Fix CE-303
 discard 3361ea0  CE-305: don't allow backup policy deletion if vmbackups use it
 discard 8a70f23  better job deletion logic
 discard 8723698  CE-304: usage type/id should be of the VM
 discard 49f0f29  CE300 etc: do access check for vmbackup's VM and allow 
restoring of a destroyed VM that is not expunged yet.
 discard 506e8ec  CE-302: restoring a root disk to another VM from a backup 
shouldnot add
 discard f33ab55  Fix CE298
 discard 5c2a460  don't allow reimport of imported policy and don't allow 
non-root users to list external policies
 discard 820b445  implemented access/privilege checks based on the access on 
the VM
 discard 4c1afcf  fix NPE in case usage metrics updation got a removed vmbackup
 discard 0bf0fbf  Other round of bugfixes
 discard bceb29f  Bugfixes: import destroyed VM, check if VM is stopped only 
for existing VMs, and others
 discard 2fe6c44  bugfix: allow listing of vmbackups of removed VMs



[cloudstack] annotated tag 4.11.2-snap deleted (was 5aa139c)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to annotated tag 4.11.2-snap
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag 4.11.2-snap was deleted! ***

   tag was  5aa139c

The revisions that were on this annotated tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack] tag brphase1 deleted (was ebb6032)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to tag brphase1
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag brphase1 was deleted! ***

 was ebb6032  Remove dependency of removed module

This change permanently discards the following revisions:

 discard ebb6032  Remove dependency of removed module
 discard f504759  Add missing header
 discard 1caa117  Refactor and marvin tests stabilization
 discard 279bc68  veeam: remove duplicate dependency
 discard 22a2989  veeam: further refactoring re:phase1, wiremock based unit test
 discard 07f6d7a  Merge branch 'bckuprecframework' of 
github.com:shapeblue/cloudstack into bckuprecframework
 discard ebf42da  Add vmware dependency on Veeam plugin
 discard 3dd3bc8  veeam: refactorings and support for various APIs
 discard cd327b1  Merge branch 'bckuprecframework' of 
github.com:shapeblue/cloudstack into bckuprecframework
 discard 5ed0cf5  Add list backups and list policy-VM mappings
 discard b259fb7  veeam: implement add/remove vm to job and kick adhoc backup 
job
 discard 979f394  List backup policy VM mappings and refactor
 discard 400f141  wip new method to allow assigning and checking of a VM to a 
Veeam job
 discard 01059d9  Remove VM from backup policy and improvements
 discard bc0c247  Refactor on restore methods
 discard 5580fe1  Adapt Veeam listBackupPolicies call to the framework
 discard 3292d99  veeam api client: xml parsing+objects for veeam backups and 
jobs
 discard 5b181be  Sanitize and refactor
 discard 9c3db12  Refactor
 discard 450627e  Marvin tests for backup policies
 discard 3729f15  BackupPolicy marvin wrappers and test
 discard 526149d  Missing header and fix unit test failures
 discard 5f00a3e  Refactor and improvements
 discard 9a69275  API final additions and schema
 discard dc4bf22  veeam: add wip API client
 discard cabe4e5  Refactor and new additions on backup provider
 discard 2b8831e  remove unused class, merge typos
 discard 68eb42b  new refactor and simplifications, add veeam plugin 
skeleton/stub
 discard a31de6c  Big refactor and improvements
 discard fcd3983  Backup and Recovery Framework and DummyProvider



[cloudstack] annotated tag cloudian-cloudstack-4.9_6.2 deleted (was 4a2e080)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to annotated tag cloudian-cloudstack-4.9_6.2
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag cloudian-cloudstack-4.9_6.2 was deleted! ***

   tag was  4a2e080

This change permanently discards the following revisions:

 discard d9b71c7  cloudian: fix typo in UI plugin config file
 discard a327d2d  cloudian: fix logging message
 discard 2183a4f  cloudian: add logging, don't update for group 0 users
 discard 84f1a50  cloudian: HTTP204 is resource does not exist
 discard 635d1ca  cloudian: fix logging and error handling, updated docs
 discard b302e5c  cloudian: throw exceptions on operations time out, check http 
ok
 discard de5a6d0  cloudian: fix auth failure cases
 discard 160ede3  cloudian: handle auth failure, fix logging/messages
 discard 0113afc  cloudian: log for auth failures, add unit test
 discard ca209eb  cloudian: refactor package names
 discard 9930270  cloudian: Improve docs with outputs from actual rpm 
install/remove
 discard 2206741  cloudian: fix rpm pkging post install/uninstall step
 discard 34b62fa  cloudian: fix doc issues
 discard dd1c8e7  cloudian: update docs
 discard 31e6520  cloudian: refactor global setting names
 discard b8efe33  cloudian: connector docs wip
 discard bcdd481  cloudian: port docs to new connector impl
 discard 6593c41  cloudian: rpm spec building wip
 discard 370941b  cloudian: code cleanup and last refactoring/changes
 discard 23b2b34  cloudian: refactor public api
 discard 02907da  cloudian: refactor wiremock static method usage
 discard 078112d  cloudian: remove methods from test
 discard faabecc  cloudian: have pre-emptive basic http/s auth
 discard bcd12ab  cloudian: add more unit tests around delete/put/post
 discard 3e8e30a  cloudian: add more unit tests
 discard 195913d  cloudian: start adding unit tests using wiremock
 discard a699714  cloudian: move test around
 discard f50955d  cloudian: cleanup tests, wip unit testing
 discard c542b9e  cloudian: fix ui regression, throw exception on timeout
 discard bc0bb89  cloudian: refactor code around SSO and url handling
 discard 7bc74bc  cloudian: major refactorings, add logout hook on loading
 discard 269964c  cloudian: wip logout javascript hook
 discard 931e992  cloudian: set client timeouts, don't attach to message bus 
when plugin is not enabled
 discard 1382d0e  cloudian: sync first, last names and account name
 discard cefbe51  cloudian: get fresh client on each requirement, to not 
require restart everytime global setting is changed
 discard c9a23eb  cloudian: test fixes
 discard f420a19  cloudian: make mgr impl robust wrt uncaught exceptions, 
improve logging
 discard 7ef84d5  cloudian: make client refactorings, add email, use http 
status codes for comparison
 discard ca37238  cloudian: refactor client code
 discard 8f220a5  cloudian: some apis don't return response, fix add apis to 
return boolean result
 discard 738b89b  cloudian: add mandatory/missing user attribute
 discard e9244cf  cloudian: let's guard more apis wrt NPEs
 discard 7307168  cloudian: more npe fixes, around response contents (this 
needs fixing)
 discard 2188815  cloudian: fix base admin url
 discard b5d81fe  cloudian: fix NPEs
 discard 1cc3e73  cloudian: wip integration with client api/lib
 discard f85e332  cloudian: support most crud apis for user/group wip
 discard 5f86ad6  cloudian: api request experiments
 discard 77e1535  cloudian: add client/test stubs using apache hc (httpclient)
 discard 64aeba6  cloudian: file path/name refactorings
 discard 4c6ed44  ui: use http GET redirection for now until Tom sorts out 
POST-ability of SSO
 discard 38e72d6  cloudian: fix sso param generation code
 discard d537afd  cloudian: POST does not work :(
 discard a61c430  cloudian: port sso signature generation code
 discard ceb0b9f  cloudian: ui integration
 discard d4085ac  cloudian: ui plugin enable/disable based on api/setting value
 discard 32ffe1e  cloudian: wip ui->cmc opening
 discard db76972  cloudian: wip sso integration
 discard 170ad66  cloudian: fix NPE
 discard e1983c9  cloudian: add message bus listeners
 discard f9b3b4a  cloudian: add configs from connector props file to db
 discard df1a802  cloudian: add connector plugin stubs
 discard 60b9142  cloudian: UI plugin stub



[cloudstack] annotated tag portgroup_no_gc_tag deleted (was ffe8428)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to annotated tag portgroup_no_gc_tag
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag portgroup_no_gc_tag was deleted! ***

   tag was  ffe8428

The revisions that were on this annotated tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[cloudstack] annotated tag rvr_fix deleted (was 568f531)

2019-01-10 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to annotated tag rvr_fix
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


*** WARNING: tag rvr_fix was deleted! ***

   tag was  568f531

This change permanently discards the following revisions:

 discard 8299cd1  ensure public interfaces are down on the backup redundent 
router



[cloudstack] branch master updated (cea8036 -> 50cc057)

2019-01-10 Thread rohit
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 cea8036  VMTemplateZone needs some love (#1730)
 add e56c499  vmware: syncVolumeToRootFolder method to avoid an infite 
recursive loop (#3105)
 new 50cc057  Merge remote-tracking branch 'origin/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:
 .../main/java/com/cloud/storage/resource/VmwareStorageLayoutHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[cloudstack] 01/01: Merge remote-tracking branch 'origin/4.11'

2019-01-10 Thread rohit
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 50cc0572db167e6889159432d8f1f916a96c0e50
Merge: cea8036 e56c499
Author: Rohit Yadav 
AuthorDate: Fri Jan 11 01:14:10 2019 +0530

Merge remote-tracking branch 'origin/4.11'

 .../main/java/com/cloud/storage/resource/VmwareStorageLayoutHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




[cloudstack] branch master updated: db: Fixes #2935 GC MySQL error (#3115)

2019-01-12 Thread rohit
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 8849382  db: Fixes #2935 GC MySQL error (#3115)
8849382 is described below

commit 8849382f772b6ced7d3b97533dd6f4c9ff352e50
Author: Rohit Yadav 
AuthorDate: Sun Jan 13 11:16:57 2019 +0530

db: Fixes #2935 GC MySQL error (#3115)

This fixes the variable name to adhere to the DB framework convention
as defined by the method interceptor that creates attributes:


https://github.com/apache/cloudstack/blob/master/framework/db/src/main/java/com/cloud/utils/db/SearchBase.java#L480

Signed-off-by: Rohit Yadav 
---
 .../src/main/java/com/cloud/offerings/NetworkOfferingVO.java  | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/engine/schema/src/main/java/com/cloud/offerings/NetworkOfferingVO.java 
b/engine/schema/src/main/java/com/cloud/offerings/NetworkOfferingVO.java
index 8c501be..338ef57 100644
--- a/engine/schema/src/main/java/com/cloud/offerings/NetworkOfferingVO.java
+++ b/engine/schema/src/main/java/com/cloud/offerings/NetworkOfferingVO.java
@@ -128,7 +128,7 @@ public class NetworkOfferingVO implements NetworkOffering {
 boolean inline;
 
 @Column(name = "is_persistent")
-boolean isPersistent;
+boolean persistent;
 
 @Column(name = "for_vpc")
 boolean forVpc;
@@ -348,7 +348,7 @@ public class NetworkOfferingVO implements NetworkOffering {
 this.elasticLb = false;
 this.inline = false;
 this.specifyIpRanges = specifyIpRanges;
-this.isPersistent = isPersistent;
+this.persistent = isPersistent;
 this.publicLb = publicLb;
 this.internalLb = internalLb;
 this.forVpc = isForVpc;
@@ -481,12 +481,12 @@ public class NetworkOfferingVO implements NetworkOffering 
{
 }
 
 public void setIsPersistent(Boolean isPersistent) {
-this.isPersistent = isPersistent;
+this.persistent = isPersistent;
 }
 
 @Override
 public boolean isPersistent() {
-return isPersistent;
+return persistent;
 }
 
 @Override



[cloudstack] branch master updated (df6288f -> 1725130)

2019-01-15 Thread rohit
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 df6288f  Extend PR#2535 to enable remote debugging for CentOS63 as 
well (#3128)
 add 1725130  server: Fix failing test_nic_secondaryip_add_remove test 
(#3129)

No new revisions were added by this update.

Summary of changes:
 .../java/com/cloud/network/NetworkServiceImpl.java | 990 ++---
 1 file changed, 474 insertions(+), 516 deletions(-)



[cloudstack] branch master updated: server: use resource UUID instead of resource ID in API response (#2527) (#3099)

2019-01-15 Thread rohit
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 1a6eb4b  server: use resource UUID instead of resource ID in API 
response (#2527) (#3099)
1a6eb4b is described below

commit 1a6eb4b856a4ff01afddc850a9fca274ab1b72da
Author: Anurag Awasthi <43956255+anura...@users.noreply.github.com>
AuthorDate: Tue Jan 15 14:05:16 2019 +0530

server: use resource UUID instead of resource ID in API response (#2527) 
(#3099)

List resourcedetails was adding DB ID instead of UUID. This is a security 
risk and needs fix.

Fixes: #2527
---
 .../java/com/cloud/api/query/QueryManagerImpl.java | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java 
b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
index 9351470..f75f711 100644
--- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
@@ -153,7 +153,6 @@ import com.cloud.api.query.vo.UserAccountJoinVO;
 import com.cloud.api.query.vo.UserVmJoinVO;
 import com.cloud.api.query.vo.VolumeJoinVO;
 import com.cloud.dc.DedicatedResourceVO;
-import com.cloud.dc.dao.DataCenterDetailsDao;
 import com.cloud.dc.dao.DedicatedResourceDao;
 import com.cloud.domain.Domain;
 import com.cloud.domain.DomainVO;
@@ -205,6 +204,7 @@ import com.cloud.utils.DateUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.StringUtils;
 import com.cloud.utils.Ternary;
+import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.JoinBuilder;
 import com.cloud.utils.db.SearchBuilder;
@@ -330,7 +330,7 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
 private DomainRouterDao _routerDao;
 
 @Inject
-UserVmDetailsDao _userVmDetailDao;
+private UserVmDetailsDao _userVmDetailDao;
 
 @Inject
 private HighAvailabilityManager _haMgr;
@@ -342,7 +342,7 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
 private TemplateJoinDao _templateJoinDao;
 
 @Inject
-ResourceManager _resourceMgr;
+private ResourceManager _resourceMgr;
 @Inject
 private ResourceMetaDataService _resourceMetaDataMgr;
 
@@ -350,7 +350,7 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
 private TaggedResourceService _taggedResourceMgr;
 
 @Inject
-AffinityGroupVMMapDao _affinityGroupVMMapDao;
+private AffinityGroupVMMapDao _affinityGroupVMMapDao;
 
 @Inject
 private AffinityGroupJoinDao _affinityGroupJoinDao;
@@ -359,22 +359,22 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
 private DedicatedResourceDao _dedicatedDao;
 
 @Inject
-DataCenterDetailsDao _dcDetailsDao;
+private DomainManager _domainMgr;
 
 @Inject
-DomainManager _domainMgr;
+private AffinityGroupDomainMapDao _affinityGroupDomainMapDao;
 
 @Inject
-AffinityGroupDomainMapDao _affinityGroupDomainMapDao;
+private NetworkDetailsDao _networkDetailsDao;
 
 @Inject
-NetworkDetailsDao _networkDetailsDao;
+private ResourceTagDao _resourceTagDao;
 
 @Inject
-ResourceTagDao _resourceTagDao;
+private DataStoreManager dataStoreManager;
 
 @Inject
-DataStoreManager dataStoreManager;
+private EntityManager _entityMgr;
 
 /*
  * (non-Javadoc)
@@ -3674,7 +3674,7 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
 
 protected ResourceDetailResponse 
createResourceDetailsResponse(ResourceDetail requestedDetail, 
ResourceTag.ResourceObjectType resourceType) {
 ResourceDetailResponse resourceDetailResponse = new 
ResourceDetailResponse();
-
resourceDetailResponse.setResourceId(String.valueOf(requestedDetail.getResourceId()));
+
resourceDetailResponse.setResourceId(_taggedResourceMgr.getUuid(String.valueOf(requestedDetail.getResourceId()),
 resourceType));
 resourceDetailResponse.setName(requestedDetail.getName());
 resourceDetailResponse.setValue(requestedDetail.getValue());
 resourceDetailResponse.setForDisplay(requestedDetail.isDisplay());



[cloudstack] branch 6d4b980643a8c69cda68e9101ce835aa6f1ce835 created (now e56c499)

2019-01-15 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch 6d4b980643a8c69cda68e9101ce835aa6f1ce835
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


  at e56c499  vmware: syncVolumeToRootFolder method to avoid an infite 
recursive loop (#3105)

No new revisions were added by this update.



[cloudstack] branch 6d4b980643a8c69cda68e9101ce835aa6f1ce835 deleted (was e56c499)

2019-01-15 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch 6d4b980643a8c69cda68e9101ce835aa6f1ce835
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


 was e56c499  vmware: syncVolumeToRootFolder method to avoid an infite 
recursive loop (#3105)

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] 02/02: restart logic is not necessary, the agent will attempt reconnect when old ks/certs are invalid

2019-01-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch agent-reconnect-fix
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 919bb3959b045e158d629015b76101785357fb49
Author: Rohit Yadav 
AuthorDate: Wed Jan 16 13:38:19 2019 +0530

restart logic is not necessary, the agent will attempt reconnect when old 
ks/certs are invalid

Signed-off-by: Rohit Yadav 
---
 scripts/util/keystore-cert-import | 10 --
 1 file changed, 10 deletions(-)

diff --git a/scripts/util/keystore-cert-import 
b/scripts/util/keystore-cert-import
index 6a2f1ac..424ab4a 100755
--- a/scripts/util/keystore-cert-import
+++ b/scripts/util/keystore-cert-import
@@ -41,12 +41,6 @@ fi
 # Use a new keystore file
 NEW_KS_FILE="$KS_FILE.new"
 
-# Check/store old KS state
-OLD_KS_FILE_EXISTS=false
-if [ -f $KS_FILE ]; then
-OLD_KS_FILE_EXISTS=true
-fi
-
 # Import certificate
 if [ ! -z "${CERT// }" ]; then
 echo "$CERT" > "$CERT_FILE"
@@ -104,10 +98,6 @@ if [ -f "$SYSTEM_FILE" ]; then
 chmod 755 /usr/local/share/ca-certificates/cloudstack
 chmod 644 /usr/local/share/ca-certificates/cloudstack/ca.crt
 update-ca-certificates > /dev/null 2>&1 || true
-# Restart cloud service if keystore was changed
-if [ "$MODE" == "ssh" ] && $OLD_KS_FILE_EXISTS; then
-systemctl restart cloud > /dev/null 2>&1
-fi
 fi
 
 # Fix file permission



[cloudstack] 01/02: keystore: restart systemvm cloud.service only when old keystore exist

2019-01-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch agent-reconnect-fix
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 658dae49f25f7875180ace072e59e23e5db03ce9
Author: Rohit Yadav 
AuthorDate: Wed Jan 16 13:31:13 2019 +0530

keystore: restart systemvm cloud.service only when old keystore exist

This ensures that the systemvm agent (cloud.service) is not restarted
when old keystore does not exist. However, on subsequent reboots of
systemvm this will try to restart cloud.service after importing X509
certificates.

Signed-off-by: Rohit Yadav 
---
 scripts/util/keystore-cert-import | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/scripts/util/keystore-cert-import 
b/scripts/util/keystore-cert-import
index 96196d9..6a2f1ac 100755
--- a/scripts/util/keystore-cert-import
+++ b/scripts/util/keystore-cert-import
@@ -41,6 +41,12 @@ fi
 # Use a new keystore file
 NEW_KS_FILE="$KS_FILE.new"
 
+# Check/store old KS state
+OLD_KS_FILE_EXISTS=false
+if [ -f $KS_FILE ]; then
+OLD_KS_FILE_EXISTS=true
+fi
+
 # Import certificate
 if [ ! -z "${CERT// }" ]; then
 echo "$CERT" > "$CERT_FILE"
@@ -98,11 +104,10 @@ if [ -f "$SYSTEM_FILE" ]; then
 chmod 755 /usr/local/share/ca-certificates/cloudstack
 chmod 644 /usr/local/share/ca-certificates/cloudstack/ca.crt
 update-ca-certificates > /dev/null 2>&1 || true
-fi
-
-# Restart cloud service if we're in systemvm
-if [ "$MODE" == "ssh" ] && [ -f $SYSTEM_FILE ]; then
-systemctl restart cloud > /dev/null 2>&1
+# Restart cloud service if keystore was changed
+if [ "$MODE" == "ssh" ] && $OLD_KS_FILE_EXISTS; then
+systemctl restart cloud > /dev/null 2>&1
+fi
 fi
 
 # Fix file permission



[cloudstack] branch agent-reconnect-fix created (now 919bb39)

2019-01-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch agent-reconnect-fix
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


  at 919bb39  restart logic is not necessary, the agent will attempt 
reconnect when old ks/certs are invalid

This branch includes the following new commits:

 new 658dae4  keystore: restart systemvm cloud.service only when old 
keystore exist
 new 919bb39  restart logic is not necessary, the agent will attempt 
reconnect when old ks/certs are invalid

The 2 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.




[cloudstack] branch agent-reconnect-fix deleted (was 919bb39)

2019-01-16 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch agent-reconnect-fix
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


 was 919bb39  restart logic is not necessary, the agent will attempt 
reconnect when old ks/certs are invalid

This change permanently discards the following revisions:

 discard 919bb39  restart logic is not necessary, the agent will attempt 
reconnect when old ks/certs are invalid
 discard 658dae4  keystore: restart systemvm cloud.service only when old 
keystore exist



[cloudstack] branch 4.11 updated: scripts: don't restart systemvm cloud.service post cert import (#3134)

2019-01-16 Thread rohit
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 53ec27c  scripts: don't restart systemvm cloud.service post cert 
import (#3134)
53ec27c is described below

commit 53ec27cd7a6e68124249a7f8c3c432d744ca9218
Author: Rohit Yadav 
AuthorDate: Wed Jan 16 21:48:57 2019 +0530

scripts: don't restart systemvm cloud.service post cert import (#3134)

This ensures that the systemvm agent (cloud.service) is not restarted
on certificate import. The agent has an inbuilt logic to attempt 
reconnection.
If the old certificates/keystore is invalid agent will attempt reconnection.

Signed-off-by: Rohit Yadav 
---
 scripts/util/keystore-cert-import | 5 -
 1 file changed, 5 deletions(-)

diff --git a/scripts/util/keystore-cert-import 
b/scripts/util/keystore-cert-import
index 96196d9..424ab4a 100755
--- a/scripts/util/keystore-cert-import
+++ b/scripts/util/keystore-cert-import
@@ -100,11 +100,6 @@ if [ -f "$SYSTEM_FILE" ]; then
 update-ca-certificates > /dev/null 2>&1 || true
 fi
 
-# Restart cloud service if we're in systemvm
-if [ "$MODE" == "ssh" ] && [ -f $SYSTEM_FILE ]; then
-systemctl restart cloud > /dev/null 2>&1
-fi
-
 # Fix file permission
 chmod 600 $CACERT_FILE
 chmod 600 $CERT_FILE



[cloudstack] branch master updated: db: alter cloud.sslcerts fingerprint column from varchar(62) to text (#3132)

2019-01-16 Thread rohit
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 2d37b74  db: alter cloud.sslcerts fingerprint column from varchar(62) 
to text (#3132)
2d37b74 is described below

commit 2d37b746b8e8d472c6d2a5e643c6cf74d7b4ef3b
Author: Matheus Marabesi 
AuthorDate: Thu Jan 17 08:56:22 2019 +0100

db: alter cloud.sslcerts fingerprint column from varchar(62) to text (#3132)

As described in the issue #3123 the certificate endpoint throws an 
exception when a request is made to create the certificate.
Fixes #3123
---
 engine/schema/src/main/resources/META-INF/db/schema-41120to41200.sql | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/engine/schema/src/main/resources/META-INF/db/schema-41120to41200.sql 
b/engine/schema/src/main/resources/META-INF/db/schema-41120to41200.sql
index 78c512b..fb588e8 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41120to41200.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41120to41200.sql
@@ -46,3 +46,6 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 
'DEFAULT', 'Storag
 -- add KVM Guest OS mapping for Windows Server 2019
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, 
created) VALUES (276, UUID(), 6, 'Windows Server 2019 (64-bit)', now());
 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', 'Windows Server 2019', 276, now(), 0);
+
+-- changed fingerprint type to TEXT, it avoids db exception when creating the 
certificate issue #3123
+ALTER TABLE `cloud`.`sslcerts` MODIFY `fingerprint` TEXT;
\ No newline at end of file



[cloudstack] branch master updated: README: silently revert project logo

2019-01-17 Thread rohit
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 c5debc4  README: silently revert project logo
c5debc4 is described below

commit c5debc4904d183864821f6dd7692c0af76405cb2
Author: Rohit Yadav 
AuthorDate: Fri Jan 18 01:12:30 2019 +0530

README: silently revert project logo

Reverts project logo in README.md without raising any attention,
coverity project has been removed by their parent sponsor add badges
from sonarcloud instead for static analysis.

Signed-off-by: Rohit Yadav 
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 7b36711..100080e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Apache CloudStack [![Build 
Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack)
 [![Coverity Scan Build 
Status](https://scan.coverity.com/projects/943/badge.svg)](https://scan.coverity.com/projects/943)
+# Apache CloudStack [![Build 
Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack)
 [![Quality Gate 
Status](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apachecloudstack)
 [![Lines of 
Code](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=ncloc)](https://sonarcloud.io/dashboard?id=apachecloudstack)
 
-![Apache CloudStack](tools/logo/acsxmas.jpg)
+![Apache CloudStack](tools/logo/apache_cloudstack.png)
 
 Apache CloudStack is open source software designed to deploy and manage large
 networks of virtual machines, as a highly available, highly scalable



[cloudstack] branch master updated: scripts: don't restart systemvm cloud.service post cert import (#3134)

2019-01-17 Thread rohit
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 53ec27c  scripts: don't restart systemvm cloud.service post cert 
import (#3134)
 new 3aaf281  Merge remote-tracking branch 'origin/4.11'
53ec27c is described below

commit 53ec27cd7a6e68124249a7f8c3c432d744ca9218
Author: Rohit Yadav 
AuthorDate: Wed Jan 16 21:48:57 2019 +0530

scripts: don't restart systemvm cloud.service post cert import (#3134)

This ensures that the systemvm agent (cloud.service) is not restarted
on certificate import. The agent has an inbuilt logic to attempt 
reconnection.
If the old certificates/keystore is invalid agent will attempt reconnection.

Signed-off-by: Rohit Yadav 
---
 scripts/util/keystore-cert-import | 5 -
 1 file changed, 5 deletions(-)

diff --git a/scripts/util/keystore-cert-import 
b/scripts/util/keystore-cert-import
index 96196d9..424ab4a 100755
--- a/scripts/util/keystore-cert-import
+++ b/scripts/util/keystore-cert-import
@@ -100,11 +100,6 @@ if [ -f "$SYSTEM_FILE" ]; then
 update-ca-certificates > /dev/null 2>&1 || true
 fi
 
-# Restart cloud service if we're in systemvm
-if [ "$MODE" == "ssh" ] && [ -f $SYSTEM_FILE ]; then
-systemctl restart cloud > /dev/null 2>&1
-fi
-
 # Fix file permission
 chmod 600 $CACERT_FILE
 chmod 600 $CERT_FILE



[cloudstack-www] branch asf-site updated (8b6824a -> 1af5f3e)

2019-01-18 Thread rohit
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a change to branch asf-site
in repository https://gitbox.apache.org/repos/asf/cloudstack-www.git.


from 8b6824a  update asf-site from master branch source
 new 35ad18c  Merge pull request #50 from apache/asf-site
 new 5de2ef7  Updated build instructions.
 new 1768ee1  Merge pull request #1 from bwsw/asf-site
 new 872c8bd  1. Changed index page for better informing of the users about 
releases. 2. Added known users and fixed headers. 3. Removed survey links 
because it looks like the method is unmaintained and doesn't work in practice.
 new 26bf236  Small fix.
 new 7d0aad4  Improved developer resources.
 new e007e81  Developer resources fix.
 new 5e18fb4  Fixed Daan's comments
 new 38f404f  Daan's comments fixed
 new 0b156c5  Fixed Daan's comments.
 new 4eff4ea  Ported contributing.md to developers guide. Removed 
unfunctional screencast.
 new 4aad232  Merge pull request #51 from bwsw/content-fixes
 new 9de2d84  Update
 new 8982b0a  Merge pull request #47 from andrijapanic/patch-1
 new e6f9455  Update cloudstack.yml
 new 591db2d  Merge remote-tracking branch 'origin/master' into asf-site
 new 9afcc04  website: fix release notes link
 new 1af5f3e  Merge branch 'master' into asf-site

The 181 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:
 content/downloads.html  | 6 +++---
 content/index.html  | 2 +-
 source/downloads.md.erb | 6 +++---
 source/index.html.erb   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)



[cloudstack-www] branch master updated (e6f9455 -> 9afcc04)

2019-01-18 Thread rohit
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-www.git.


from e6f9455  Update cloudstack.yml
 add 9afcc04  website: fix release notes link

No new revisions were added by this update.

Summary of changes:
 content/archives.html   |  1 +
 content/downloads.html  | 18 +-
 content/index.html  |  6 +++---
 content/users.html  |  2 +-
 source/downloads.md.erb |  6 +++---
 source/index.html.erb   |  2 +-
 6 files changed, 18 insertions(+), 17 deletions(-)



[cloudstack] branch 4.11 updated: packaging: management default file cleanup (#3139)

2019-01-25 Thread rohit
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 463372b  packaging: management default file cleanup (#3139)
463372b is described below

commit 463372bc7ea13e15c1ec0aa8808095bb2e053d07
Author: Rohit Yadav 
AuthorDate: Fri Jan 25 22:19:33 2019 +0530

packaging: management default file cleanup (#3139)

This cleanups management server default file, the `cloud.jks` is no
longer created by the management server but instead created in-memory
by the root CA plugin on management server startup.

Signed-off-by: Rohit Yadav 
---
 client/conf/java.security.ciphers.in| 32 -
 packaging/systemd/cloudstack-management.default |  6 +
 2 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/client/conf/java.security.ciphers.in 
b/client/conf/java.security.ciphers.in
index 27e2d69..6e7620e 100644
--- a/client/conf/java.security.ciphers.in
+++ b/client/conf/java.security.ciphers.in
@@ -1,18 +1,18 @@
- # 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.
+# 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.
 
 jdk.tls.disabledAlgorithms=SSLv2Hello, SSLv3, TLSv1, TLSv1.1, DH keySize < 
128, RSA keySize < 128, DES keySize < 128, SHA1 keySize < 128, MD5 keySize < 
128, RC4
diff --git a/packaging/systemd/cloudstack-management.default 
b/packaging/systemd/cloudstack-management.default
index fbdb256..8610e03 100644
--- a/packaging/systemd/cloudstack-management.default
+++ b/packaging/systemd/cloudstack-management.default
@@ -18,11 +18,7 @@
 # Where your java installation lives
 #JAVA_HOME="/usr/lib/jvm/java"
 
-if [ -r "/etc/cloudstack/management/cloud.jks" ] ; then
-  JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false 
-Xmx2g -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M 
-XX:MaxPermSize=800m 
-Djavax.net.ssl.trustStore=/etc/cloudstack/management/cloud.jks 
-Djavax.net.ssl.trustStorePassword=vmops.com 
-Djava.security.properties=/etc/cloudstack/management/java.security.ciphers "
-else
-  JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false 
-Xmx2g -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M 
-XX:MaxPermSize=800m 
-Djava.security.properties=/etc/cloudstack/management/java.security.ciphers "
-fi
+JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false 
-Xmx2g -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M 
-XX:MaxPermSize=800m 
-Djava.security.properties=/etc/cloudstack/management/java.security.ciphers "
 
 CLOUDSTACK_USER="cloud"
 



[cloudstack-documentation] branch 4.11 updated: Update requirements for Ubuntu 18.04 (#22)

2019-01-25 Thread rohit
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 6307766  Update requirements for Ubuntu 18.04 (#22)
6307766 is described below

commit 6307766484878f571a91234885fc2cf1afeb5e21
Author: Andrija Panic 
AuthorDate: Fri Jan 25 17:55:59 2019 +0100

Update requirements for Ubuntu 18.04 (#22)

Updated guide to support Ubuntu 18.04, since python3 is default, and also 
default java version is 10
---
 source/installguide/building_from_source.rst | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/source/installguide/building_from_source.rst 
b/source/installguide/building_from_source.rst
index 508899d..74967ec 100644
--- a/source/installguide/building_from_source.rst
+++ b/source/installguide/building_from_source.rst
@@ -180,9 +180,14 @@ Install Python MySQL connector using the official MySQL 
packages repository.
 MySQL connector APT repository
 ~~
 
+.. note::
+
+   Procedure below should work for Ubuntu 14.04 and 16.04.
+   For Ubuntu 18.04, please read later below.
+
 Install the following package provided by MySQL to enable official 
repositories:
 
-.. note:
+.. note::
 
If the download fails check the current version number. The version 
available may
have been updated.
@@ -199,6 +204,16 @@ Make sure to activate the repository for MySQL connectors.
sudo apt-get update
sudo apt-get install mysql-connector-python   
 
+.. note::
+   Below is given a bit different procedure if you are compiling on Ubuntu 
18.04
+
+Due to default python version changes (and some others) in Ubuntu 18.04 
version, we will need to install python 2.7, python-mysql.connector from 
Universe repo (instead from official MySQL repo) and later make sure we are 
using Java 8, since Java 10 comes as default
+
+.. parsed-literal::
+
+   apt-add-repository universe
+   apt-get install python-mysql.connector python-setuptools dh-systemd
+   (installs python 2.7 with needed dependencies)
 
 MySQL connector RPM repository
 ~~
@@ -239,6 +254,11 @@ several other dependencies. Note that we recommend using 
Maven 3.
$ sudo apt-get install python-software-properties
$ sudo apt-get update
$ sudo apt-get install debhelper openjdk-8-jdk libws-commons-util-java 
genisoimage libcommons-codec-java libcommons-httpclient-java liblog4j1.2-java 
maven
+   
+.. note::
+
+If on Ubuntu 18.04, in above command, please replace 
"python-software-properties" with "software-properties-common"
+If on Ubuntu 18.04, above command will install both Java 10 and Java 8, so 
make sure to switch to Java8 with "update-alternatives --config java" - 
otherwise you will get errors during dependency check and code compiling.
 
 While we have defined, and you have presumably already installed the
 bootstrap prerequisites, there are a number of build time prerequisites



[cloudstack-documentation] branch security-tls-config created (now 617c434)

2019-01-25 Thread rohit
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.


  at 617c434  installdocs: docs for https and TLS setup/configuration

This branch includes the following new commits:

 new 7085861  initial commit of new layout/consolidated documentation
 new c907535  per domain configs
 new 715c7e1  add livirt hook script documentation into new section called 
additional network features
 new 4d004f8  wording and header corrections
 new 24cb4db  links footnotes added
 new dc450d4  moved to hosts
 new 1d12b1c  remove licence
 new 3c19612  Merge pull request #3 from ernjvr/libvirt-hook-script
 new ecf451c  Merge pull request #1 from DaanHoogland/domainLdap
 new ddc2485  Formating fix to show code
 new 2b7f8e9  Merge pull request #9 from andrijapanic/patch-1
 new cfc18df  bridge section was missing (#12)
 new b44f390  "yes" for KVM network throtling support (#11)
 new 4667dbd  Snapshots, not live migrations ? (#10)
 new 8570940  4.11.2 - initial documentation update (WIP)
 new f84d193  Merge pull request #21 from shapeblue/4.11
 new 920c8f5  systemvmtemplate: use other 64-bit linux for vmware
 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 617c434  installdocs: docs for https and TLS setup/configuration

The 21 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.




[cloudstack-documentation] 10/21: Formating fix to show code

2019-01-25 Thread rohit
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 ddc2485de125b4c0c2a98cc8716320d912d33edf
Author: Andrija Panic 
AuthorDate: Wed Oct 10 00:11:51 2018 +0200

Formating fix to show code

"flush tables with read lock..." and few more lines were hidden due to 
formatting...
---
 source/installguide/optional_installation.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/installguide/optional_installation.rst 
b/source/installguide/optional_installation.rst
index d352f06..de2d328 100644
--- a/source/installguide/optional_installation.rst
+++ b/source/installguide/optional_installation.rst
@@ -150,7 +150,7 @@ steps are a guide to implementing MySQL replication.
assumes that master and slave run on the 172.16.1.0/24 network.
 
.. sourcecode: bash
-
+   .. parsed-literal::
   # mysql -u root
   mysql> create user 'cloud-repl'@'172.16.1.%' identified by 'password';
   mysql> grant replication slave on *.* TO 'cloud-repl'@'172.16.1.%';



[cloudstack-documentation] 08/21: Merge pull request #3 from ernjvr/libvirt-hook-script

2019-01-25 Thread rohit
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 3c19612c0df526ccd9a84408abb00d6ddb7c95fb
Merge: 7085861 1d12b1c
Author: Paul Angus 
AuthorDate: Thu Sep 13 16:07:43 2018 +0100

Merge pull request #3 from ernjvr/libvirt-hook-script

Livirt hook script documentation

 source/adminguide/hosts.rst  | 100 +++
 source/adminguide/networking_and_traffic.rst |   1 -
 2 files changed, 100 insertions(+), 1 deletion(-)



[cloudstack-documentation] 14/21: Snapshots, not live migrations ? (#10)

2019-01-25 Thread rohit
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 4667dbd493f7f25d9c998104bbc472ba8b7b4f0c
Author: Andrija Panic 
AuthorDate: Mon Nov 12 06:47:22 2018 +0100

Snapshots, not live migrations ? (#10)

If memory serves me correctly, this was only related to snapshots (copy 
over from Primary to Secondary Stor.) - and has nothing to do with live 
migrations ???
---
 source/installguide/hypervisor/kvm.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/installguide/hypervisor/kvm.rst 
b/source/installguide/hypervisor/kvm.rst
index 1ea8eec..c5cc5ff 100644
--- a/source/installguide/hypervisor/kvm.rst
+++ b/source/installguide/hypervisor/kvm.rst
@@ -1091,13 +1091,13 @@ installed on all of your KVM hosts.
 As this package often is not available in standard distribution repos, you 
will need
 to install the package from your preferred source. 
 
-Live Migration
+Volume snapshots
 ^^
-CloudStack uses the qemu-img to perform live migrations.  In CentOS > 6.3, the 
qemu-img
+CloudStack uses the qemu-img to perform snapshots.  In CentOS >= 6.5, the 
qemu-img
 supplied by RedHat/CentOS ceased to include a '-s' switch which performs 
snapshots. The
 '-s' switch has been restored in latest CentOS/RHEL 7.x versions.
 
-In order to be able to perform live migrations on CentOS 6.x (greater than 
6.3) you must
+In order to be able to perform volume snapshots on CentOS 6.x (greater than 
6.4) you must
 replace your version of qemu-img with one which has been patched to include 
the '-s'
 switch.
 



[cloudstack-documentation] 19/21: Updated the linux password script location (#25)

2019-01-25 Thread rohit
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 d61d226220043f2a5c8a1648aab048b40bff930f
Author: Glenn Wagner 
AuthorDate: Wed Jan 9 18:22:11 2019 +0200

Updated the linux password script location (#25)
---
 source/adminguide/templates/_password.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/adminguide/templates/_password.rst 
b/source/adminguide/templates/_password.rst
index dffde52..eab791e 100644
--- a/source/adminguide/templates/_password.rst
+++ b/source/adminguide/templates/_password.rst
@@ -48,8 +48,8 @@ Use the following steps to begin the Linux OS installation:
 
 #. Download the script file cloud-set-guest-password:
 
-   -  
`http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in 
-  
<http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in>`_
+   -  
`https://github.com/apache/cloudstack/blob/master/setup/bindir/cloud-set-guest-password.in
 
+  
<https://github.com/apache/cloudstack/blob/master/setup/bindir/cloud-set-guest-password.in>`_
 
 #. Rename the file:
 



[cloudstack-documentation] 15/21: 4.11.2 - initial documentation update (WIP)

2019-01-25 Thread rohit
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 857094013fcc4bdedf7bdf1b4f05bde0a1f44181
Author: Paul Angus 
AuthorDate: Wed Nov 14 17:48:07 2018 +

4.11.2 - initial documentation update (WIP)
---
 .gitignore |   1 +
 source/_global.rst |  17 +-
 source/conceptsandterminology/network_setup.rst|   2 +-
 source/conf.py |   2 +-
 .../installguide/management-server/_systemvm.rst   |  12 +-
 source/releasenotes/about.rst  |   7 +
 source/releasenotes/fixed_issues.rst   | 258 -
 source/upgrading/upgrade/_mysql_connector.rst  |   6 +-
 source/upgrading/upgrade/_sysvm_templates.rst  |  16 +-
 source/upgrading/upgrade/upgrade-4.10.rst  |   3 -
 source/upgrading/upgrade/upgrade-4.11.rst  |  90 +--
 11 files changed, 306 insertions(+), 108 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..567609b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build/
diff --git a/source/_global.rst b/source/_global.rst
index ca35d38..3167d2d 100644
--- a/source/_global.rst
+++ b/source/_global.rst
@@ -23,12 +23,19 @@
 
 .. |documentation_home| replace:: http://docs.cloudstack.apache.org/
 
+.. Latest version systemvm template name
+.. |sysvm64-name-xen|replace:: systemvm-xenserver-4.11.2
+.. |sysvm64-name-kvm|replace:: systemvm-kvm-4.11.2
+.. |sysvm64-name-vmware| replace:: systemvm-vmware-4.11.2
+.. |sysvm64-name-hyperv| replace:: systemvm-hyperv-4.11.2
+.. |sysvm64-name-ovm|replace:: systemvm-ovm-4.11.2
+
 .. Latest version systemvm template URL
-.. |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
+.. |sysvm64-url-xen|replace:: 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-xen.vhd.bz2
+.. |sysvm64-url-kvm|replace:: 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-kvm.qcow2.bz2
+.. |sysvm64-url-vmware| replace:: 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-vmware.ova
+.. |sysvm64-url-hyperv| replace:: 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-hyperv.vhd.zip
+.. |sysvm64-url-ovm|replace:: 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-ovm.raw.bz2
 
 .. Version specific: 4.5 systemvm template URL
 .. |acs45-sysvm64-url-xen|replace:: 
http://download.cloudstack.org/systemvm/4.5/systemvm64template-4.5-xen.vhd.bz2
diff --git a/source/conceptsandterminology/network_setup.rst 
b/source/conceptsandterminology/network_setup.rst
index 08ddf5e..1137dc9 100644
--- a/source/conceptsandterminology/network_setup.rst
+++ b/source/conceptsandterminology/network_setup.rst
@@ -619,7 +619,7 @@ Adding a VNMC Instance
 
 #. Click OK.
 
-.. adding-an-asa-1000v-instance:
+.. _adding-an-asa-1000v-instance:
 
 Adding an ASA 1000v Instance
 
diff --git a/source/conf.py b/source/conf.py
index 5bc7660..0fbfe0d 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -26,7 +26,7 @@ author = 'Apache CloudStack Project'
 # The short X.Y version
 version = '4.11'
 # The full version, including alpha/beta/rc tags
-release = '4.11.1.0'
+release = '4.11.2.0'
 
 rst_epilog = """
 .. include:: /_global.rst 
diff --git a/source/installguide/management-server/_systemvm.rst 
b/source/installguide/management-server/_systemvm.rst
index 9bbb197..744c1c7 100644
--- a/source/installguide/management-server/_systemvm.rst
+++ b/source/installguide/management-server/_systemvm.rst
@@ -45,7 +45,7 @@ CloudStack system VMs.
 
  
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
  -m /mnt/secondary \
- -u 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-hyperv.vhd.zip
 \
+ -u |sysvm64-url-hyperv| \
  -h hyperv \
  -s  \
  -F
@@ -56,7 +56,7 @@ CloudStack system VMs.
 
  
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
  -m /mnt/secondary \
- -u 
http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-xen.vhd.bz2
 \
+ -u |sysvm64-url-xen| \
  -h xenserver \
  

[cloudstack-documentation] 06/21: moved to hosts

2019-01-25 Thread rohit
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 dc450d41ff520f070cf6a10773f4c78a7698aed2
Author: ernjvr 
AuthorDate: Wed Aug 29 14:09:55 2018 +0200

moved to hosts
---
 source/adminguide/hosts.rst| 115 
 .../networking/additional_networking_features.rst  | 120 -
 source/adminguide/networking_and_traffic.rst   |   2 -
 3 files changed, 115 insertions(+), 122 deletions(-)

diff --git a/source/adminguide/hosts.rst b/source/adminguide/hosts.rst
index 71b55d7..41a88a3 100644
--- a/source/adminguide/hosts.rst
+++ b/source/adminguide/hosts.rst
@@ -745,3 +745,118 @@ 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.
+
+.. 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
+
+
+Feature Overview
+~
+
+-  This feature applies to KVM hosts.
+-  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 `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 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
+~~
+
+-  The cloudstack-agent package will install the qemu script in the 
/etc/libvirt/hooks directory of Libvirt.
+-  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.
+#. Name of the operation being performed. For example, 'start' if a guest 
is being started.
+#. Sub-operation indication, or '-' if there is none.
+#. An extra argument string, or '-' if there is none.
+
+-  The operation argument is based on what actions KVM and Libvirt are 
carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 
'migrate', 'restore', 'reconnect', 'attach'.
+
+-  If an invalid operation argument is received, the qemu script will log the 
fact, not execute any custom scripts and exit.
+
+-  All input arguments that are passed to the qemu script will also be passed 
to each custom script. 
+
+-  For each of the above actions, the qemu script will find and run scripts by 
the name "_" in a custom include path 
/etc/libvirt/hooks/custom/. Custom scripts that do not follow this naming 
convention will be ignored

[cloudstack-documentation] 03/21: add livirt hook script documentation into new section called additional network features

2019-01-25 Thread rohit
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 715c7e12c5f9b8873eac8c2221a39556ef3f1e40
Author: ernjvr 
AuthorDate: Mon Aug 27 15:45:12 2018 +0200

add livirt hook script documentation into new section called additional 
network features
---
 .../networking/additional_networking_features.rst  | 109 +
 source/adminguide/networking_and_traffic.rst   |   1 +
 2 files changed, 110 insertions(+)

diff --git a/source/adminguide/networking/additional_networking_features.rst 
b/source/adminguide/networking/additional_networking_features.rst
new file mode 100644
index 000..c15aa46
--- /dev/null
+++ b/source/adminguide/networking/additional_networking_features.rst
@@ -0,0 +1,109 @@
+.. 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.
+
+
+Additional Networking Features
+---
+
+
+KVM Libvirt Hook Script Include
+~~~
+
+**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.
+
+-  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 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.
+
+**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 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 performed. For example, "start" if a guest 
is being started.
+#. Sub-operation indication, or '-' if there is none.
+#. An extra argument string, or '-' if there is none.
+
+-  The operation argument is based on what actions KVM and Libvirt are 
carrying out on each VM: 'prepare', 'start', 'started', 'stopped', 'release', 
'migrate', 'restore', 'reconnect', 'attach'.
+
+-  If an invalid operation argument is received, the hook script will log the 
fact, not execute any custom scripts and exit.
+
+-  All input arguments that are passed to the Libvirt hook script are also be 
passed to each user-specific custom script. 
+
+-  For each of the above actions, the "qemu" hook script will find and run 
scripts by the name "_". These user-specific scripts will run every 
time the hook script is called with a valid Libvirt action.
+-  In the case of mul

[cloudstack-documentation] 16/21: Merge pull request #21 from shapeblue/4.11

2019-01-25 Thread rohit
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 f84d1930c0cb41f0f317291ff1189d56c76467b9
Merge: 4667dbd 8570940
Author: Paul Angus 
AuthorDate: Wed Nov 21 09:31:29 2018 +

Merge pull request #21 from shapeblue/4.11

4.11.2 - initial documentation update

 .gitignore |   1 +
 source/_global.rst |  17 +-
 source/conceptsandterminology/network_setup.rst|   2 +-
 source/conf.py |   2 +-
 .../installguide/management-server/_systemvm.rst   |  12 +-
 source/releasenotes/about.rst  |   7 +
 source/releasenotes/fixed_issues.rst   | 258 -
 source/upgrading/upgrade/_mysql_connector.rst  |   6 +-
 source/upgrading/upgrade/_sysvm_templates.rst  |  16 +-
 source/upgrading/upgrade/upgrade-4.10.rst  |   3 -
 source/upgrading/upgrade/upgrade-4.11.rst  |  90 +--
 11 files changed, 306 insertions(+), 108 deletions(-)



[cloudstack-documentation] 20/21: Update requirements for Ubuntu 18.04 (#22)

2019-01-25 Thread rohit
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 6307766484878f571a91234885fc2cf1afeb5e21
Author: Andrija Panic 
AuthorDate: Fri Jan 25 17:55:59 2019 +0100

Update requirements for Ubuntu 18.04 (#22)

Updated guide to support Ubuntu 18.04, since python3 is default, and also 
default java version is 10
---
 source/installguide/building_from_source.rst | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/source/installguide/building_from_source.rst 
b/source/installguide/building_from_source.rst
index 508899d..74967ec 100644
--- a/source/installguide/building_from_source.rst
+++ b/source/installguide/building_from_source.rst
@@ -180,9 +180,14 @@ Install Python MySQL connector using the official MySQL 
packages repository.
 MySQL connector APT repository
 ~~
 
+.. note::
+
+   Procedure below should work for Ubuntu 14.04 and 16.04.
+   For Ubuntu 18.04, please read later below.
+
 Install the following package provided by MySQL to enable official 
repositories:
 
-.. note:
+.. note::
 
If the download fails check the current version number. The version 
available may
have been updated.
@@ -199,6 +204,16 @@ Make sure to activate the repository for MySQL connectors.
sudo apt-get update
sudo apt-get install mysql-connector-python   
 
+.. note::
+   Below is given a bit different procedure if you are compiling on Ubuntu 
18.04
+
+Due to default python version changes (and some others) in Ubuntu 18.04 
version, we will need to install python 2.7, python-mysql.connector from 
Universe repo (instead from official MySQL repo) and later make sure we are 
using Java 8, since Java 10 comes as default
+
+.. parsed-literal::
+
+   apt-add-repository universe
+   apt-get install python-mysql.connector python-setuptools dh-systemd
+   (installs python 2.7 with needed dependencies)
 
 MySQL connector RPM repository
 ~~
@@ -239,6 +254,11 @@ several other dependencies. Note that we recommend using 
Maven 3.
$ sudo apt-get install python-software-properties
$ sudo apt-get update
$ sudo apt-get install debhelper openjdk-8-jdk libws-commons-util-java 
genisoimage libcommons-codec-java libcommons-httpclient-java liblog4j1.2-java 
maven
+   
+.. note::
+
+If on Ubuntu 18.04, in above command, please replace 
"python-software-properties" with "software-properties-common"
+If on Ubuntu 18.04, above command will install both Java 10 and Java 8, so 
make sure to switch to Java8 with "update-alternatives --config java" - 
otherwise you will get errors during dependency check and code compiling.
 
 While we have defined, and you have presumably already installed the
 bootstrap prerequisites, there are a number of build time prerequisites



[cloudstack-documentation] 09/21: Merge pull request #1 from DaanHoogland/domainLdap

2019-01-25 Thread rohit
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 ecf451ce81b71d672793f3b1f3130af7fbc5670a
Merge: 3c19612 c907535
Author: Paul Angus 
AuthorDate: Fri Sep 14 09:50:57 2018 +0100

Merge pull request #1 from DaanHoogland/domainLdap

per domain ldap configs

 source/adminguide/accounts.rst | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)



[cloudstack-documentation] 21/21: installdocs: docs for https and TLS setup/configuration

2019-01-25 Thread rohit
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 617c434706d9f24be6d098197cbd8e754d74175c
Author: Rohit Yadav 
AuthorDate: Fri Jan 25 22:42:35 2019 +0530

installdocs: docs for https and TLS setup/configuration

Signed-off-by: Rohit Yadav 
---
 source/installguide/optional_installation.rst | 38 +++
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/source/installguide/optional_installation.rst 
b/source/installguide/optional_installation.rst
index de2d328..c512bb1 100644
--- a/source/installguide/optional_installation.rst
+++ b/source/installguide/optional_installation.rst
@@ -92,15 +92,43 @@ 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.
+
+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)
 ---



<    2   3   4   5   6   7   8   9   10   11   >