[GitHub] cloudstack pull request #1925: CLOUDSTACK-9751: Fix public ip not applied, w...

2017-02-01 Thread fmaximus
GitHub user fmaximus opened a pull request:

https://github.com/apache/cloudstack/pull/1925

CLOUDSTACK-9751: Fix public ip not applied, when added while VR is starting

Public IP state wasn't passed to the vsp client, making it ignore the apply 
public ip.

Bugfix-for: 4.9
Bug-ID: CLOUDSTACK-9751
Reported-By: Raf Smeets <raf.sme...@nuagenetworks.net>

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/fmaximus/cloudstack bugfix/CLOUDSTACK-9751

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1925.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1925


commit 971cfe79c682418c5891310bd5466728afcdb5f2
Author: Frank Maximus <frank.maxi...@nuagenetworks.net>
Date:   2017-02-01T15:25:09Z

CLOUDSTACK-9751: Fix public ip not applied, when added while VR is starting.

Bugfix-for: 4.9
Bug-ID: CLOUDSTACK-9751
Reported-By: Raf Smeets <raf.sme...@nuagenetworks.net>




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1912: CLOUDSTACK-9749: Disable password service on ...

2017-01-19 Thread fmaximus
GitHub user fmaximus opened a pull request:

https://github.com/apache/cloudstack/pull/1912

CLOUDSTACK-9749: Disable password service on ilb systemvm

Fix cloud-password-srvr correctly.
Made sure it runs on VPC VR, but not on Internal LB

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/fmaximus/cloudstack bugfix/CLOUDSTACK-9749

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1912.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1912


commit aea01bbf372645a45450cc7912795544917b000d
Author: Frank Maximus <frank.maxi...@nuagenetworks.net>
Date:   2017-01-19T15:55:46Z

CLOUDSTACK-9749: Disable password service on ilb systemvm




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack issue #1662: Fix bug juniper srx

2017-01-19 Thread fmaximus
Github user fmaximus commented on the issue:

https://github.com/apache/cloudstack/pull/1662
  
Seems the fork is gone. I propose we close this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1904: Use latest Nuage client.

2017-01-12 Thread fmaximus
GitHub user fmaximus opened a pull request:

https://github.com/apache/cloudstack/pull/1904

Use latest Nuage client.

CloudStack root pom change to use Amazon WS 11.1.16
caused our client to fail, as it was depending on classes,
which are not not present anymore.
Latest client version uses Gson instead.

BUG-ID: CLOUDSTACK-9729
Bugfix-for: master

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/fmaximus/cloudstack bugfix/CLOUDSTACK-9729

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1904.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1904


commit ec4216476eb274b970c5e319cae57887f68a45f8
Author: Frank Maximus <frank.maxi...@nuagenetworks.net>
Date:   2017-01-12T13:15:22Z

Use latest Nuage client.

CloudStack root pom change to use Amazon WS 11.1.16
caused our client to fail, as it was depending on classes,
which are not not present anymore.
Latest client version uses Gson instead.

BUG-ID: CLOUDSTACK-9729
Bugfix-for: master




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1579: CLOUDSTACK-9403 : Support for shared networks...

2016-12-02 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1579#discussion_r90624351
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResourceConfiguration.java
 ---
@@ -0,0 +1,310 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.network.resource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import net.nuage.vsp.acs.client.api.model.NuageVspUser;
+import net.nuage.vsp.acs.client.api.model.VspHost;
+import net.nuage.vsp.acs.client.common.NuageVspApiVersion;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.cloud.util.NuageVspUtil;
+
+public class NuageVspResourceConfiguration {
--- End diff --

We also want to keep the specifics of resource configuration
which are stored in host details out of the client library.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1579: CLOUDSTACK-9403 : Support for shared networks...

2016-12-02 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1579#discussion_r90623492
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResourceConfiguration.java
 ---
@@ -0,0 +1,310 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.network.resource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import net.nuage.vsp.acs.client.api.model.NuageVspUser;
+import net.nuage.vsp.acs.client.api.model.VspHost;
+import net.nuage.vsp.acs.client.common.NuageVspApiVersion;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.cloud.util.NuageVspUtil;
+
+public class NuageVspResourceConfiguration {
+private static final String NAME = "name";
+private static final String GUID = "guid";
+private static final String ZONE_ID = "zoneid";
+private static final String HOST_NAME = "hostname";
+private static final String CMS_USER = "cmsuser";
+private static final String CMS_USER_PASSWORD = "cmsuserpass";
+private static final String PORT = "port";
+private static final String API_VERSION = "apiversion";
+private static final String API_RELATIVE_PATH = "apirelativepath";
+private static final String RETRY_COUNT = "retrycount";
+private static final String RETRY_INTERVAL = "retryinterval";
+private static final String NUAGE_VSP_CMS_ID = "nuagevspcmsid";
+
+private static final String CMS_USER_ENTEPRISE_NAME = "CSP";
+
+private String _name;
+private String _guid;
+private String _zoneId;
+private String _hostName;
+private String _cmsUser;
+private String _cmsUserPassword;
+private String _port;
+private String _apiVersion;
+private String _apiRelativePath;
+private String _retryCount;
+private String _retryInterval;
+private String _nuageVspCmsId;
+
+public String name() {
+return _name;
+}
+
+public String guid() {
+return this._guid;
+}
+
+public NuageVspResourceConfiguration guid(String guid) {
+this._guid = guid;
+return this;
+}
+
+public String zoneId() {
+return this._zoneId;
+}
+
+public NuageVspResourceConfiguration zoneId(String zoneId) {
+this._zoneId = zoneId;
+return this;
+}
+
+public String hostName() {
+return this._hostName;
+}
+
+public NuageVspResourceConfiguration hostName(String hostName) {
+this._hostName = hostName;
+this._name = "Nuage VSD - " + _hostName;
+return this;
+}
+
+public String cmsUser() {
+return this._cmsUser;
+}
+
+public NuageVspResourceConfiguration cmsUser(String cmsUser) {
+this._cmsUser = cmsUser;
+return this;
+}
+
+public String cmsUserPassword() {
+return this._cmsUserPassword;
+}
+
+public NuageVspResourceConfiguration cmsUserPassword(String 
cmsUserPassword) {
+this._cmsUserPassword = cmsUserPassword;
+return this;
+}
+
+public String port() {
+return this._port;
+}
+
+public NuageVspResourceConfiguration port(String port) {
+this._port = port;
+return this;
+}
+
+public String apiVersion() {
+return this._apiVersion;
+}
+
+public NuageVspResourceConfiguration apiVersion(String apiVersion) {
+this._apiVersion = apiVersion;
+return this;
+}
+
+pu

[GitHub] cloudstack pull request #1579: CLOUDSTACK-9403 : Support for shared networks...

2016-12-02 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1579#discussion_r90623476
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResourceConfiguration.java
 ---
@@ -0,0 +1,310 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.network.resource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import net.nuage.vsp.acs.client.api.model.NuageVspUser;
+import net.nuage.vsp.acs.client.api.model.VspHost;
+import net.nuage.vsp.acs.client.common.NuageVspApiVersion;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.cloud.util.NuageVspUtil;
+
+public class NuageVspResourceConfiguration {
+private static final String NAME = "name";
+private static final String GUID = "guid";
+private static final String ZONE_ID = "zoneid";
+private static final String HOST_NAME = "hostname";
+private static final String CMS_USER = "cmsuser";
+private static final String CMS_USER_PASSWORD = "cmsuserpass";
+private static final String PORT = "port";
+private static final String API_VERSION = "apiversion";
+private static final String API_RELATIVE_PATH = "apirelativepath";
+private static final String RETRY_COUNT = "retrycount";
+private static final String RETRY_INTERVAL = "retryinterval";
+private static final String NUAGE_VSP_CMS_ID = "nuagevspcmsid";
+
+private static final String CMS_USER_ENTEPRISE_NAME = "CSP";
+
+private String _name;
+private String _guid;
+private String _zoneId;
+private String _hostName;
+private String _cmsUser;
+private String _cmsUserPassword;
+private String _port;
+private String _apiVersion;
+private String _apiRelativePath;
+private String _retryCount;
+private String _retryInterval;
+private String _nuageVspCmsId;
+
+public String name() {
+return _name;
+}
+
+public String guid() {
+return this._guid;
+}
+
+public NuageVspResourceConfiguration guid(String guid) {
+this._guid = guid;
+return this;
+}
+
+public String zoneId() {
+return this._zoneId;
+}
+
+public NuageVspResourceConfiguration zoneId(String zoneId) {
+this._zoneId = zoneId;
+return this;
+}
+
+public String hostName() {
+return this._hostName;
+}
+
+public NuageVspResourceConfiguration hostName(String hostName) {
+this._hostName = hostName;
+this._name = "Nuage VSD - " + _hostName;
+return this;
+}
+
+public String cmsUser() {
+return this._cmsUser;
+}
+
+public NuageVspResourceConfiguration cmsUser(String cmsUser) {
+this._cmsUser = cmsUser;
+return this;
+}
+
+public String cmsUserPassword() {
+return this._cmsUserPassword;
+}
+
+public NuageVspResourceConfiguration cmsUserPassword(String 
cmsUserPassword) {
+this._cmsUserPassword = cmsUserPassword;
+return this;
+}
+
+public String port() {
+return this._port;
+}
+
+public NuageVspResourceConfiguration port(String port) {
+this._port = port;
+return this;
+}
+
+public String apiVersion() {
+return this._apiVersion;
+}
+
+public NuageVspResourceConfiguration apiVersion(String apiVersion) {
+this._apiVersion = apiVersion;
+return this;
+}
+
+pu

[GitHub] cloudstack pull request #1579: CLOUDSTACK-9403 : Support for shared networks...

2016-12-02 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1579#discussion_r90619259
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResourceConfiguration.java
 ---
@@ -0,0 +1,310 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.network.resource;
--- End diff --

It's like that in all other plugins.
If needed we can rename all packages,
but let's not do it now anymore, 
as we want to get it still in, in 4.10
We would have to requalify everything.
Let's discuss, and fix it in a next PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1579: CLOUDSTACK-9403 : Support for shared networks...

2016-11-30 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1579#discussion_r90236739
  
--- Diff: api/src/com/cloud/network/Network.java ---
@@ -215,6 +216,8 @@ public static Provider getProvider(String providerName) 
{
 public static final Capability DistributedRouter = new 
Capability("DistributedRouter");
 public static final Capability StretchedL2Subnet = new 
Capability("StretchedL2Subnet");
 public static final Capability RegionLevelVpc = new 
Capability("RegionLevelVpc");
+public static final Capability NoVlan = new Capability("NoVlan");
+public static final Capability PublicAccess = new 
Capability("PublicAccess");
--- End diff --

NoVlan is a Capability we're currently using when adding a new IP range to 
an existing shared network. Without this, the Broadcast URI would become 
vlan://untagged, while the shared network has a Broadcast URI of 
vsp://network-uuid. When the CIDR of the new ip range is the same as one of the 
already existing ip ranges, it would still not be allowed as the vlan id is 
different. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack issue #1579: CLOUDSTACK-9403 : Support for shared networks in Nua...

2016-11-29 Thread fmaximus
Github user fmaximus commented on the issue:

https://github.com/apache/cloudstack/pull/1579
  
Rebased and squashed all commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-09-07 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r77851893
  
--- Diff: test/integration/plugins/nuagevsp/nuageTestCase.py ---
@@ -631,195 +753,257 @@ def check_Router_state(self, router, state=None):
 self.assertEqual(routers[0].state, state,
  "Virtual router is not in the expected state"
  )
-self.debug("Successfully validated the deployment and state of 
Router - %s" % router.name)
+self.debug("Successfully validated the deployment and state of 
Router "
+   "- %s" % router.name)
 
-# validate_PublicIPAddress - Validates if the given public IP address 
is in the expected state form the list of
-# fetched public IP addresses
-def validate_PublicIPAddress(self, public_ip, network, 
static_nat=False, vm=None):
+# validate_PublicIPAddress - Validates if the given public IP address 
is in
+# the expected state form the list of fetched public IP addresses
+def validate_PublicIPAddress(self, public_ip, network, 
static_nat=False,
+ vm=None):
 """Validates the Public IP Address"""
-self.debug("Validating the assignment and state of public IP 
address - %s" % public_ip.ipaddress.ipaddress)
+self.debug("Validating the assignment and state of public IP 
address "
+   "- %s" % public_ip.ipaddress.ipaddress)
 public_ips = PublicIPAddress.list(self.api_client,
   id=public_ip.ipaddress.id,
   networkid=network.id,
   isstaticnat=static_nat,
   listall=True
   )
 self.assertEqual(isinstance(public_ips, list), True,
- "List public IP for network should return a valid 
list"
+ "List public IP for network should return a "
+ "valid list"
  )
-self.assertEqual(public_ips[0].ipaddress, 
public_ip.ipaddress.ipaddress,
- "List public IP for network should list the 
assigned public IP address"
+self.assertEqual(public_ips[0].ipaddress,
+ public_ip.ipaddress.ipaddress,
+ "List public IP for network should list the 
assigned "
+ "public IP address"
  )
 self.assertEqual(public_ips[0].state, "Allocated",
  "Assigned public IP is not in the allocated state"
  )
 if static_nat and vm:
 self.assertEqual(public_ips[0].virtualmachineid, vm.id,
- "Static NAT rule is not enabled for the VM on 
the assigned public IP"
+ "Static NAT rule is not enabled for the VM on 
"
+ "the assigned public IP"
  )
-self.debug("Successfully validated the assignment and state of 
public IP address - %s" %
-   public_ip.ipaddress.ipaddress)
+self.debug("Successfully validated the assignment and state of 
public "
+   "IP address - %s" % public_ip.ipaddress.ipaddress)
 
-# VSD verifications
-# VSD is a programmable policy and analytics engine of Nuage VSP SDN 
platform
+# VSD verifications; VSD is a programmable policy and analytics engine 
of
+# Nuage VSP SDN platform
 
-# get_externalID_filter - Returns corresponding external ID filter of 
the given object in VSD
+# get_externalID_filter - Returns corresponding external ID filter of 
the
+# given object in VSD
 def get_externalID_filter(self, object_id):
 ext_id = object_id + "@" + self.cms_id
 return self.vsd.set_externalID_filter(ext_id)
 
 # fetch_by_externalID - Returns VSD object with the given external ID
 def fetch_by_externalID(self, fetcher, *cs_objects):
-""" Fetches a child object by external id using the given fetcher, 
and uuids of the given cloudstack objects.
+""" Fetches a child object by external id using the given fetcher, 
and
+uuids of the given cloudstack objects.
 E.G.
-  - 
fetch_by_external

[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-09-07 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r77831210
  
--- Diff: test/integration/plugins/nuagevsp/nuageTestCase.py ---
@@ -175,45 +234,44 @@ def tearDown(self):
 return
 
 # create_VpcOffering - Creates VPC offering
-def create_VpcOffering(self, vpc_offering, suffix=None):
-self.debug("Creating VPC offering")
+@needscleanup
+def create_VpcOffering(cls, vpc_offering, suffix=None):
+cls.debug("Creating VPC offering")
 if suffix:
 vpc_offering["name"] = "VPC_OFF-" + str(suffix)
-vpc_off = VpcOffering.create(self.api_client,
+vpc_off = VpcOffering.create(cls.api_client,
  vpc_offering
  )
 # Enable VPC offering
-vpc_off.update(self.api_client, state="Enabled")
-self.cleanup.append(vpc_off)
-self.debug("Created and Enabled VPC offering")
+vpc_off.update(cls.api_client, state="Enabled")
+cls.debug("Created and Enabled VPC offering")
 return vpc_off
 
 # create_Vpc - Creates VPC with the given VPC offering
-def create_Vpc(self, vpc_offering, cidr='10.1.0.0/16', testdata=None, 
account=None, networkDomain=None,
-   cleanup=True):
+@needscleanup
+def create_Vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
+   account=None, networkDomain=None):
 if not account:
-account = self.account
-self.debug("Creating a VPC in the account - %s" % account.name)
+account = cls.account
+cls.debug("Creating a VPC in the account - %s" % account.name)
 if not testdata:
-testdata = self.test_data["vpc"]
+testdata = cls.test_data["vpc"]
 testdata["name"] = "TestVPC-" + cidr + "-" + 
str(vpc_offering.name)
 testdata["displaytext"] = "Test VPC"
 testdata["cidr"] = cidr
-vpc = VPC.create(self.api_client,
+vpc = VPC.create(cls.api_client,
  testdata,
  vpcofferingid=vpc_offering.id,
- zoneid=self.zone.id,
+ zoneid=cls.zone.id,
  account=account.name,
  domainid=account.domainid,
  networkDomain=networkDomain
  )
-self.debug("Created VPC with ID - %s" % vpc.id)
-if cleanup:
-self.cleanup.append(vpc)
+cls.debug("Created VPC with ID - %s" % vpc.id)
 return vpc
 
 # restart_Vpc - Restarts the given VPC with/without cleanup
-def restart_Vpc(self, vpc, cleanup=None):
+def restart_Vpc(self, vpc, cleanup=False):
--- End diff --

It's just a parameter passed into the restartVPC command.
I'm more concerned about the fact that we need to set makeredundant to 
false, 
as the default seems to be true.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-09-07 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r77818579
  
--- Diff: server/src/com/cloud/network/element/VirtualRouterElement.java ---
@@ -988,6 +1016,21 @@ public boolean addDhcpEntry(final Network network, 
final NicProfile nic, final V
 return result;
 }
 
+protected boolean deleteDhcpSupportForSubnet(Network network, 
Network.Service service) throws ResourceUnavailableException {
+if (canHandle(network, service)) {
+final List routers = 
_routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
+if (routers == null || routers.size() == 0) {
+throw new ResourceUnavailableException("Can't find at 
least one router!", DataCenter.class, network.getDataCenterId());
+}
+try {
+return _routerMgr.removeDhcpSupportForSubnet(network, 
routers);
+} catch (final ResourceUnavailableException e) {
+s_logger.debug("Router resource unavailable ");
--- End diff --

Here we moved existing code from removeDhcpSupportForSubnet to a separate 
method, containing the service. 
Another question is, why catch ResourceUnavailableException, if it is also 
present in the method's throws clause? It then would be logged by the invoking 
methods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-09-07 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r77800584
  
--- Diff: test/integration/plugins/nuagevsp/nuageTestCase.py ---
@@ -77,85 +117,104 @@ def setUpClass(cls, zone=None):
 cls.test_data["virtual_machine"]["zoneid"] = cls.zone.id
 cls.test_data["virtual_machine"]["template"] = cls.template.id
 
-# Create service offering
-cls.service_offering = ServiceOffering.create(cls.api_client,
-  
cls.test_data["service_offering"]
-  )
-cls._cleanup = [cls.service_offering]
-
 # Check if the host hypervisor type is simulator
-cls.isSimulator = Hypervisor.list(cls.api_client, 
zoneid=cls.zone.id)[0].name == "Simulator"
+cls.isSimulator = Hypervisor.list(
+cls.api_client,
+zoneid=cls.zone.id)[0].name == "Simulator"
 
 # Get configured Nuage VSP device details
 try:
-physical_networks = PhysicalNetwork.list(cls.api_client, 
zoneid=cls.zone.id)
+physical_networks = PhysicalNetwork.list(
+cls.api_client,
+zoneid=cls.zone.id
+)
 for pn in physical_networks:
 if pn.isolationmethods == "VSP":
 cls.vsp_physical_network = pn
 break
-cls.nuage_vsp_device = Nuage.list(cls.api_client,
-  
physicalnetworkid=cls.vsp_physical_network.id
-  )[0]
+cls.nuage_vsp_device = Nuage.list(
+cls.api_client,
+physicalnetworkid=cls.vsp_physical_network.id)[0]
 pns = cls.config.zones[0].physical_networks
-providers = filter(lambda physical_network: "VSP" in 
physical_network.isolationmethods, pns)[0].providers
-devices = filter(lambda provider: provider.name == "NuageVsp", 
providers)[0].devices
+providers = filter(lambda physical_network:
+   "VSP" in physical_network.isolationmethods,
+   pns)[0].providers
+devices = filter(lambda provider:
+ provider.name == "NuageVsp",
+ providers)[0].devices
 cls.nuage_vsp_device.username = devices[0].username
 cls.nuage_vsp_device.password = devices[0].password
 cls.cms_id = cls.nuage_vsp_device.cmsid
 except Exception as e:
 cls.tearDownClass()
-raise unittest.SkipTest("Warning: Could not get configured 
Nuage VSP device details - %s" % e)
+raise unittest.SkipTest("Warning: Could not get configured "
+"Nuage VSP device details - %s" % e)
--- End diff --

If the datacenter, against which the tests are run, is not configured with 
Nuage VSP
we want to skip the Nuage VSP related tests instead of failing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-08-31 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r76993494
  
--- Diff: 
engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 ---
@@ -2645,6 +2669,18 @@ public DhcpServiceProvider 
getDhcpServiceProvider(final Network network) {
 }
 }
 
+@Override
+public DnsServiceProvider getDnsServiceProvider(final Network network) 
{
+final String DnsProvider = 
_ntwkSrvcDao.getProviderForServiceInNetwork(network.getId(), Service.Dns);
--- End diff --

Variables should start lowecase


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-08-31 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r76991083
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -242,6 +249,40 @@ public void reserve(NicProfile nic, Network network, 
VirtualMachineProfile vm, D
 throw new IllegalStateException("The broadcast URI path " 
+ network.getBroadcastUri() + " is empty or in an incorrect format.");
 }
 
+HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
+VspNetwork vspNetwork = 
_nuageVspEntityBuilder.buildVspNetwork(network, false);
+
+// Set flags for dhcp options
+boolean networkHasDns = networkHasDns(network);
+Boolean defaultHasDns = null;
+// Determine if dhcp options of the other nics in the network 
need to be updated
+if (VirtualMachine.Type.DomainRouter.equals(vm.getType()) && 
!State.Implementing.equals(network.getState())) {
+// Update dhcp options if a VR is added when we are not 
initiating the network
+s_logger.debug(String.format("DomainRouter is added to an 
existing network: %s in state: %s", network.getName(), network.getState()));
+List dhcpOptions = Lists.newArrayList();
+for (NicVO userNic 
:_nicDao.listByNetworkId(network.getId())){
+if 
(!VirtualMachine.Type.DomainRouter.equals(userNic.getVmType())) {
+// Dhcp options for Domain router are handled later
+VMInstanceVO userVm  = 
_vmInstanceDao.findById(userNic.getInstanceId());
--- End diff --

It is not necessary to fetch the vm here, as only the id is used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...

2016-08-31 Thread fmaximus
Github user fmaximus commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1578#discussion_r76991270
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -403,4 +448,25 @@ private HostVO getNuageVspHost(long physicalNetworkId) 
{
 }
 return nuageVspHost;
 }
+
+private boolean networkHasDns(Network network) {
+
+if (network != null) {
+List dnsProvider = 
_ntwkOfferingSrvcDao.listProvidersForServiceForNetworkOffering(network.getNetworkOfferingId(),
 Network.Service.Dns);
+if (dnsProvider.contains("VirtualRouter") || 
dnsProvider.contains("VpcVirtualRouter")) {
+return true;
+}
+}
+return false;
+}
+
+
+private NetworkVO getDefaultNetwork (long vmId) {
+
+NicVO defaultNic = _nicDao.findDefaultNicForVM(vmId);
+if (defaultNic != null ) return 
_networkDao.findById(_nicDao.findById(defaultNic.getId()).getNetworkId());
--- End diff --

Not necessary to fetch the nic from DB twice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack issue #1652: Marvin Tests: Fix VPC network offering selection .

2016-08-24 Thread fmaximus
Github user fmaximus commented on the issue:

https://github.com/apache/cloudstack/pull/1652
  
I will make the change. I also plan to only create the vpc offering if 
there are Nuage VSP devices configured, which makes more sense for the users of 
CloudStack that do not use our plugin.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack issue #1652: Marvin Tests: Fix VPC network offering selection .

2016-08-22 Thread fmaximus
Github user fmaximus commented on the issue:

https://github.com/apache/cloudstack/pull/1652
  
As Nuage plugin developer, I can't come up with any good reason why it 
should be default.
Also I see that Redundant VPC Offering is set to be a default.
Both are most likely just copied from defaultVPCOfferingName creation.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-9095 : Hypervisor changes to s...

2015-12-07 Thread fmaximus
Github user fmaximus commented on the pull request:

https://github.com/apache/cloudstack/pull/1142#issuecomment-162483085
  
Are we still taking Travis into account? It has a unit test failure in 
HypervisorUtilTest, which also failed in other builds on Travis. This test 
seems to fail randomly. I've also seen that the other Travis threads, which 
were successful, in fact didn't do anything as thay failed to find nosetests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Fix NuageVsp errors for build-master-slow...

2015-11-19 Thread fmaximus
Github user fmaximus commented on the pull request:

https://github.com/apache/cloudstack/pull/1092#issuecomment-158100736
  
I think we should use StringUtils.getUtf8Bytes() instead, as we are using 
StringUtils.newStringUtf8(Base64.decodeBase64(cmsUserPassBase64)) on the other 
side (NuageVspResource:192)

Otherwise it would fail if StringUtils.getPreferredCharset() is different 
from UTF-8


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---