Allow - in Warden user name
- POSIX user name allows . and - in addition to character class \w
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_431
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278
https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum
Change-Id: I5529ee0d89be0bcc3b92f955d09834e30cbcfea4
diff --git a/utils/warden/src/main/java/org/onlab/warden/Warden.java b/utils/warden/src/main/java/org/onlab/warden/Warden.java
index 8ce6037..61091b6 100644
--- a/utils/warden/src/main/java/org/onlab/warden/Warden.java
+++ b/utils/warden/src/main/java/org/onlab/warden/Warden.java
@@ -169,7 +169,7 @@
synchronized String borrowCell(String userName, String sshKey, int minutes,
String cellSpec) {
checkNotNull(userName, USER_NOT_NULL);
- checkArgument(userName.matches("[\\w]+"), "Invalid user name %s", userName);
+ checkArgument(userName.matches("[\\w.-]+"), "Invalid user name %s", userName);
checkNotNull(sshKey, KEY_NOT_NULL);
checkArgument(minutes < MAX_MINUTES, "Number of minutes must be less than %d", MAX_MINUTES);
checkArgument(minutes >= 0, "Number of minutes must be non-negative");