[GitHub] cloudstack pull request: Set version 4.7.1-SNAPSHOT in 4.7 branch

2015-12-21 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1267#issuecomment-166415534
  
Nothing out of the ordinairy. LGTM


---
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: Set version 4.8.0-SNAPSHOT in master bran...

2015-12-21 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1268#issuecomment-166436287
  
Code reviewed. Nothing out of the ordinary. LGTM. There must be a better 
way to do it than to manually add it to each and every migration though.


---
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: [4.7] FIX Site2SiteVPN on redundant VPC

2015-12-22 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1276#issuecomment-166675193
  
Good to see additional tests created. I would suggest adding a test that 
turns one of the routers off, and then seeing if the VPN connection works 
correctly. I quickly looked through the component testing and didn't find any 
similar tests.

Is there a timing issue possible where both routers would be in the same 
state? If so, it might be good to throw an exception before doing any 
operations (i.e. if the loop exits, and no routers were found to be MASTER).

Also, should the check to see if the router is the MASTER occur before 
persisting the vpn connection state on each router?



---
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: [4.7] FIX Site2SiteVPN on redundant VPC

2015-12-22 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1276#discussion_r48278591
  
--- Diff: 
server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java ---
@@ -916,6 +916,9 @@ protected void updateSite2SiteVpnConnectionState(final 
List rout
 }
 continue;
 }
+if (router.getIsRedundantRouter() && 
router.getRedundantState() != RedundantState.MASTER){
--- End diff --

Should this check be done before the previous 'if'?


---
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: Removed unused methods from EventBus inte...

2015-12-22 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1260#issuecomment-166691207
  
Did you try rebuilding CS with each type of event queue? 


---
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-9200: Fixed failed to delete s...

2015-12-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1282#issuecomment-166910265
  
How do you know if there are no jobs associated with it?


---
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-9196: Fixing null pointer exce...

2015-12-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1274#issuecomment-166910961
  
Shouldn't we log this information? Doesn't this mean that some resources 
could be freed up on the hypervisor?


---
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: README: happy holidays!

2015-12-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1281#issuecomment-166911537
  
lol @DaanHoogland . +1


---
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-9196: Fixing null pointer exce...

2015-12-24 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1274#issuecomment-167135604
  
Null check LGTM


---
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: Add ability to download templates in Swif...

2016-01-13 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1332#discussion_r49605888
  
--- Diff: 
plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
 ---
@@ -67,7 +73,28 @@ public DataStoreTO getStoreTO(DataStore store) {
 
 @Override
 public String createEntityExtractUrl(DataStore store, String 
installPath, ImageFormat format, DataObject dataObject) {
-throw new UnsupportedServiceException("Extract entity url is not 
yet supported for Swift image store provider");
+
+SwiftTO swiftTO = (SwiftTO)store.getTO();
+String tempKey = UUID.randomUUID().toString();
+boolean result = SwiftUtil.setTempKey(swiftTO, tempKey);
+
+if (!result) {
+s_logger.error("Unable to set Temp-Key: " + tempKey);
+return "";
--- End diff --

Why return empty here, and null later?


---
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: Add ability to download templates in Swif...

2016-01-13 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1332#discussion_r49606475
  
--- Diff: 
plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
 ---
@@ -67,7 +73,28 @@ public DataStoreTO getStoreTO(DataStore store) {
 
 @Override
 public String createEntityExtractUrl(DataStore store, String 
installPath, ImageFormat format, DataObject dataObject) {
-throw new UnsupportedServiceException("Extract entity url is not 
yet supported for Swift image store provider");
+
+SwiftTO swiftTO = (SwiftTO)store.getTO();
+String tempKey = UUID.randomUUID().toString();
+boolean result = SwiftUtil.setTempKey(swiftTO, tempKey);
+
+if (!result) {
+s_logger.error("Unable to set Temp-Key: " + tempKey);
+return "";
+}
+
+String containerName = 
SwiftUtil.getContainerName(dataObject.getType().toString(), dataObject.getId());
+String objectName = installPath.split("\\/")[1];
+// Get extract url expiration interval set in global configuration 
(in seconds)
+int urlExpirationInterval = 
Integer.parseInt(_configDao.getValue(Config.ExtractURLExpirationInterval.toString()));
+
+URL swiftUrl = SwiftUtil.generateTempUrl(swiftTO, containerName, 
objectName, tempKey, urlExpirationInterval);
+if (swiftUrl != null) {
+s_logger.info("Swift temp-url: " + swiftUrl.toString());
--- End diff --

Should probably be DEBUG instead of INFO, or remove this the log statement


---
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: Add ability to download templates in Swif...

2016-01-13 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1332#discussion_r49606572
  
--- Diff: 
plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
 ---
@@ -67,7 +73,28 @@ public DataStoreTO getStoreTO(DataStore store) {
 
 @Override
 public String createEntityExtractUrl(DataStore store, String 
installPath, ImageFormat format, DataObject dataObject) {
-throw new UnsupportedServiceException("Extract entity url is not 
yet supported for Swift image store provider");
+
+SwiftTO swiftTO = (SwiftTO)store.getTO();
+String tempKey = UUID.randomUUID().toString();
+boolean result = SwiftUtil.setTempKey(swiftTO, tempKey);
+
+if (!result) {
+s_logger.error("Unable to set Temp-Key: " + tempKey);
+return "";
+}
+
+String containerName = 
SwiftUtil.getContainerName(dataObject.getType().toString(), dataObject.getId());
+String objectName = installPath.split("\\/")[1];
+// Get extract url expiration interval set in global configuration 
(in seconds)
+int urlExpirationInterval = 
Integer.parseInt(_configDao.getValue(Config.ExtractURLExpirationInterval.toString()));
+
+URL swiftUrl = SwiftUtil.generateTempUrl(swiftTO, containerName, 
objectName, tempKey, urlExpirationInterval);
+if (swiftUrl != null) {
+s_logger.info("Swift temp-url: " + swiftUrl.toString());
+return swiftUrl.toString();
+}
+
--- End diff --

Could instead add a log statement here that indicates that the extraction 
url could not be created for the container and object


---
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: Add ability to download templates in Swif...

2016-01-13 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1332#discussion_r49606982
  
--- Diff: utils/src/main/java/com/cloud/utils/SwiftUtil.java ---
@@ -236,4 +247,60 @@ public static boolean deleteObject(SwiftClientCfg cfg, 
String path) {
 command.execute(parser);
 return true;
 }
+
+public static boolean setTempKey(SwiftClientCfg cfg, String tempKey){
+
+Map tempKeyMap = new HashMap<>();
+tempKeyMap.put("Temp-URL-Key", tempKey);
+return postMeta(cfg, "", "", tempKeyMap);
+
+}
+
+public static URL generateTempUrl(SwiftClientCfg cfg, String 
container, String object, String tempKey, int urlExpirationInterval) {
+
+int currentTime = (int) (System.currentTimeMillis() / 1000L);
+int expirationSeconds = currentTime + urlExpirationInterval;
+
+try {
+
+URL endpoint = new URL(cfg.getEndPoint());
+String method = "GET";
+String path = String.format("/v1/AUTH_%s/%s/%s", 
cfg.getAccount(), container, object);
+
+//sign the request
+String hmacBody = String.format("%s\n%d\n%s", method, 
expirationSeconds, path);
+String signature = calculateRFC2104HMAC(hmacBody, tempKey);
+path += String.format("?temp_url_sig=%s&temp_url_expires=%d", 
signature, expirationSeconds);
+
+//generate the temp url
+URL tempUrl = new URL(endpoint.getProtocol(), 
endpoint.getHost(), endpoint.getPort(), path);
+
+return tempUrl;
+
+} catch (Exception e) {
+logger.error("Unable to generate temperoary URL " + 
e.getMessage());
--- End diff --

Should log the exception, not just the message. And why catch all 
exceptions? What exceptions are you expecting?


---
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-9192: UpdateVpnCustomerGateway...

2016-01-14 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1300#issuecomment-171666469
  
Code changes LGTM, looked in the UpdateVpnGatewayCmd and checked the 
response name (it is 'updatevpngatewayresponse').


---
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: Enhance VR performance

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50057840
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
@@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
 
 
 def main(argv):
+# The file we are currently processing, if it is "cmd_line.json" 
everything will be processed.
+process_file = argv[1]
+
+# process_file can be None, if so assume cmd_line.json
+if process_file is None:
+process_file = "cmd_line.json"
+
+# Track if changes need to be committed to NetFilter
+iptables_change = False
+
+# The "GLOBAL" Configuration object
 config = CsConfig()
+
 logging.basicConfig(filename=config.get_logger(),
 level=config.get_level(),
 format=config.get_format())
+
+# Load stored ip adresses from disk to CsConfig()
 config.set_address()
 
 logging.debug("Configuring ip addresses")
-# IP configuration
 config.address().compare()
 config.address().process()
 
-logging.debug("Configuring vmpassword")
-password = CsPassword("vmpassword", config)
-password.process()
+if process_file in ["cmd_line.json", "guest_network.json"]:
+logging.debug("Configuring Guest Network")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vm_password.json"]:
+logging.debug("Configuring vmpassword")
+password = CsPassword("vmpassword", config)
+password.process()
 
-logging.debug("Configuring vmdata")
-metadata = CsVmMetadata('vmdata', config)
-metadata.process()
+if process_file in ["cmd_line.json", "vm_metadata.json"]:
+logging.debug("Configuring vmdata")
+metadata = CsVmMetadata('vmdata', config)
+metadata.process()
 
-logging.debug("Configuring networkacl")
+# Always run both CsAcl().process() methods
+# They fill the base rules in config.fw[]
 acls = CsAcl('networkacl', config)
 acls.process()
 
-logging.debug("Configuring firewall rules")
 acls = CsAcl('firewallrules', config)
 acls.process()
 
-logging.debug("Configuring PF rules")
 fwd = CsForwardingRules("forwardingrules", config)
 fwd.process()
 
-logging.debug("Configuring s2s vpn")
 vpns = CsSite2SiteVpn("site2sitevpn", config)
 vpns.process()
 
-logging.debug("Configuring remote access vpn")
-#remote access vpn
 rvpn = CsRemoteAccessVpn("remoteaccessvpn", config)
 rvpn.process()
 
-logging.debug("Configuring vpn users list")
-#remote access vpn users
-vpnuser = CsVpnUser("vpnuserlist", config)
-vpnuser.process()
-
-logging.debug("Configuring dhcp entry")
-dhcp = CsDhcp("dhcpentry", config)
-dhcp.process()
-
-logging.debug("Configuring load balancer")
 lb = CsLoadBalancer("loadbalancer", config)
 lb.process()
 
-logging.debug("Configuring monitor service")
-mon = CsMonitor("monitorservice", config)
-mon.process()
+if process_file in ["cmd_line.json", "network_acl.json"]:
+logging.debug("Configuring networkacl")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "firewall_rules.json"]:
+logging.debug("Configuring firewall rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "forwarding_rules.json", 
"staticnat_rules.json"]:
+logging.debug("Configuring PF rules")
--- End diff --

These were configured above right?


---
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: Enhance VR performance

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50057844
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
@@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
 
 
 def main(argv):
+# The file we are currently processing, if it is "cmd_line.json" 
everything will be processed.
+process_file = argv[1]
+
+# process_file can be None, if so assume cmd_line.json
+if process_file is None:
+process_file = "cmd_line.json"
+
+# Track if changes need to be committed to NetFilter
+iptables_change = False
+
+# The "GLOBAL" Configuration object
 config = CsConfig()
+
 logging.basicConfig(filename=config.get_logger(),
 level=config.get_level(),
 format=config.get_format())
+
+# Load stored ip adresses from disk to CsConfig()
 config.set_address()
 
 logging.debug("Configuring ip addresses")
-# IP configuration
 config.address().compare()
 config.address().process()
 
-logging.debug("Configuring vmpassword")
-password = CsPassword("vmpassword", config)
-password.process()
+if process_file in ["cmd_line.json", "guest_network.json"]:
+logging.debug("Configuring Guest Network")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vm_password.json"]:
+logging.debug("Configuring vmpassword")
+password = CsPassword("vmpassword", config)
+password.process()
 
-logging.debug("Configuring vmdata")
-metadata = CsVmMetadata('vmdata', config)
-metadata.process()
+if process_file in ["cmd_line.json", "vm_metadata.json"]:
+logging.debug("Configuring vmdata")
+metadata = CsVmMetadata('vmdata', config)
+metadata.process()
 
-logging.debug("Configuring networkacl")
+# Always run both CsAcl().process() methods
+# They fill the base rules in config.fw[]
 acls = CsAcl('networkacl', config)
 acls.process()
 
-logging.debug("Configuring firewall rules")
 acls = CsAcl('firewallrules', config)
 acls.process()
 
-logging.debug("Configuring PF rules")
--- End diff --

Why remove the logging here? Or, why not bring the lower code block here to 
condtionally process the fwd rules?


---
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-6181: Add 'root disk size' fie...

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1342#discussion_r50058625
  
--- Diff: ui/scripts/ui-custom/instanceWizard.js ---
@@ -429,12 +427,52 @@
 
$step.find('.custom-size-label').remove();
 
 if (!custom) {
--- End diff --

Should become if(custom){//logic} to avoid empty condition


---
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: Enhance VR performance

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50058474
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py ---
@@ -96,29 +96,8 @@ def configure_server(self):
 self.conf.search(sline, line)
 
 def delete_leases(self):
-changed = []
-leases = []
 try:
-for line in open(LEASES):
-bits = line.strip().split(' ')
-to = {"device": bits[0],
-  "mac": bits[1],
-  "ip": bits[2],
-  "host": bits[3:],
-  "del": False
-  }
-changed.append(to)
-
-for v in changed:
-if v['mac'] == to['mac'] or v['ip'] == to['ip'] or 
v['host'] == to['host']:
-to['del'] = True
-leases.append(to)
-
-for o in leases:
-if o['del']:
-cmd = "dhcp_release eth%s %s %s" % (o['device'], 
o['ip'], o['mac'])
-logging.info(cmd)
-CsHelper.execute(cmd)
+open(LEASES, 'w').close()
--- End diff --

This truncates the file, but what about the cmd that was executed before? 
Is that handled elsewhere? 


---
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-9235: Autoscale button is miss...

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1337#discussion_r50060205
  
--- Diff: ui/scripts/network.js ---
@@ -3667,8 +3652,16 @@
 return 2; 
//hide Autoscale button (both header and form)
 }
 } else { //from VPC 
section
-//VPC doesn't 
support autoscale
-return 2;
+var 
lbProviderIsNetscaler;
+var services = 
args.context.vpc[0].service;
+
+
lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
+
+if 
(lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler 
(but not on any other provider like VirtualRouter)
--- End diff --

You could remove the condition here, it is unnecessary


---
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-9235: Autoscale button is miss...

2016-01-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1337#issuecomment-172691481
  
Code LGTM


---
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: Reducing expunge delay and interval on de...

2016-01-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1135#issuecomment-172710149
  
@DaanHoogland np, I will close the 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: Reducing expunge delay and interval on de...

2016-01-18 Thread pdube
Github user pdube closed the pull request at:

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


---
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 Sync of template.properties in Swift

2016-01-18 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1331#discussion_r50066929
  
--- Diff: 
services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
 ---
@@ -942,6 +931,83 @@ protected Answer copyFromNfsToS3(CopyCommand cmd) {
 }
 }
 
+protected boolean swiftUploadMetadataFile(SwiftTO swift, File srcFile, 
String containerName) throws IOException {
+
+
+//create a template.properties for Swift with its correct unique 
name
+File uniqDir = _storage.createUniqDir();
+String metaFileName = uniqDir.getAbsolutePath() + File.separator + 
"template.properties";
+_storage.create(uniqDir.getAbsolutePath(), "template.properties");
+
+String uniqueName = FilenameUtils.getBaseName(srcFile.getName());
+File metaFile = new File(metaFileName);
+FileWriter writer = new FileWriter(metaFile);
+BufferedWriter bufferWriter = new BufferedWriter(writer);
+bufferWriter.write("uniquename=" + uniqueName);
+bufferWriter.write("\n");
+bufferWriter.write("filename=" + srcFile.getName());
+bufferWriter.write("\n");
+bufferWriter.write("size=" + srcFile.length());
+bufferWriter.write("\n");
+bufferWriter.write("virtualsize=" + getVirtualSize(srcFile, 
getTemplateFormat(srcFile.getName(;
+bufferWriter.close();
+writer.close();
+
+SwiftUtil.putObject(swift, metaFile, containerName, _tmpltpp);
+metaFile.delete();
+uniqDir.delete();
+
+return true;
+}
+
+
+protected Answer copyFromNfsToSwift(CopyCommand cmd) {
+
+final DataTO srcData = cmd.getSrcTO();
+final DataTO destData = cmd.getDestTO();
+
+DataStoreTO srcDataStore = srcData.getDataStore();
+NfsTO srcStore = (NfsTO)srcDataStore;
+DataStoreTO destDataStore = destData.getDataStore();
+File srcFile = getFile(srcData.getPath(), srcStore.getUrl());
+
+SwiftTO swift = (SwiftTO)destDataStore;
+
+try {
+
+String containerName = 
SwiftUtil.getContainerName(destData.getObjectType().toString(), 
destData.getId());
+String swiftPath = SwiftUtil.putObject(swift, srcFile, 
containerName, srcFile.getName());
+
+
+DataTO retObj = null;
+if (destData.getObjectType() == DataObjectType.TEMPLATE) {
+swiftUploadMetadataFile(swift, srcFile, containerName);
+TemplateObjectTO newTemplate = new TemplateObjectTO();
+newTemplate.setPath(swiftPath);
+newTemplate.setSize(getVirtualSize(srcFile, 
getTemplateFormat(srcFile.getName(;
+newTemplate.setPhysicalSize(srcFile.length());
+
newTemplate.setFormat(getTemplateFormat(srcFile.getName()));
+retObj = newTemplate;
+} else if (destData.getObjectType() == DataObjectType.VOLUME) {
+VolumeObjectTO newVol = new VolumeObjectTO();
+newVol.setPath(containerName);
+newVol.setSize(srcFile.length());
--- End diff --

Not 100% related to this PR, but are the sizes on volumes and snapshots 
correct?


---
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 Sync of template.properties in Swift

2016-01-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1331#issuecomment-172715155
  
Code LGTM, as a general comment though, I think it is cleaner to be as 
precise as possible with exception handling.


---
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: Enhance VR performance

2016-01-20 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50259089
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
@@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
 
 
 def main(argv):
+# The file we are currently processing, if it is "cmd_line.json" 
everything will be processed.
+process_file = argv[1]
+
+# process_file can be None, if so assume cmd_line.json
+if process_file is None:
+process_file = "cmd_line.json"
+
+# Track if changes need to be committed to NetFilter
+iptables_change = False
+
+# The "GLOBAL" Configuration object
 config = CsConfig()
+
 logging.basicConfig(filename=config.get_logger(),
 level=config.get_level(),
 format=config.get_format())
+
+# Load stored ip adresses from disk to CsConfig()
 config.set_address()
 
 logging.debug("Configuring ip addresses")
-# IP configuration
 config.address().compare()
 config.address().process()
 
-logging.debug("Configuring vmpassword")
-password = CsPassword("vmpassword", config)
-password.process()
+if process_file in ["cmd_line.json", "guest_network.json"]:
+logging.debug("Configuring Guest Network")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vm_password.json"]:
+logging.debug("Configuring vmpassword")
+password = CsPassword("vmpassword", config)
+password.process()
 
-logging.debug("Configuring vmdata")
-metadata = CsVmMetadata('vmdata', config)
-metadata.process()
+if process_file in ["cmd_line.json", "vm_metadata.json"]:
+logging.debug("Configuring vmdata")
+metadata = CsVmMetadata('vmdata', config)
+metadata.process()
 
-logging.debug("Configuring networkacl")
+# Always run both CsAcl().process() methods
+# They fill the base rules in config.fw[]
 acls = CsAcl('networkacl', config)
 acls.process()
 
-logging.debug("Configuring firewall rules")
 acls = CsAcl('firewallrules', config)
 acls.process()
 
-logging.debug("Configuring PF rules")
 fwd = CsForwardingRules("forwardingrules", config)
 fwd.process()
 
-logging.debug("Configuring s2s vpn")
 vpns = CsSite2SiteVpn("site2sitevpn", config)
 vpns.process()
 
-logging.debug("Configuring remote access vpn")
-#remote access vpn
 rvpn = CsRemoteAccessVpn("remoteaccessvpn", config)
 rvpn.process()
 
-logging.debug("Configuring vpn users list")
-#remote access vpn users
-vpnuser = CsVpnUser("vpnuserlist", config)
-vpnuser.process()
-
-logging.debug("Configuring dhcp entry")
-dhcp = CsDhcp("dhcpentry", config)
-dhcp.process()
-
-logging.debug("Configuring load balancer")
 lb = CsLoadBalancer("loadbalancer", config)
 lb.process()
 
-logging.debug("Configuring monitor service")
-mon = CsMonitor("monitorservice", config)
-mon.process()
+if process_file in ["cmd_line.json", "network_acl.json"]:
+logging.debug("Configuring networkacl")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "firewall_rules.json"]:
+logging.debug("Configuring firewall rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "forwarding_rules.json", 
"staticnat_rules.json"]:
+logging.debug("Configuring PF rules")
--- End diff --

Hey @wilderrodrigues,

I understand the checks that are being made. However, I do not think it is 
appropriate to log that you are configuring PFR, after they have already been 
processed and configured. I think it can be misleading while 
debugging/searching logs. 

There are certain code paths that are executed regardless of the config 
file and they are only logged after the fact -> acls, fwd, vpns, rvpn, lb. So, 
if an error occurs in any of the functions, there are no logs to see what was 
being executed.


---
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: Enhance VR performance

2016-01-20 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50259249
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
@@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
 
 
 def main(argv):
+# The file we are currently processing, if it is "cmd_line.json" 
everything will be processed.
+process_file = argv[1]
+
+# process_file can be None, if so assume cmd_line.json
+if process_file is None:
+process_file = "cmd_line.json"
+
+# Track if changes need to be committed to NetFilter
+iptables_change = False
+
+# The "GLOBAL" Configuration object
 config = CsConfig()
+
 logging.basicConfig(filename=config.get_logger(),
 level=config.get_level(),
 format=config.get_format())
+
+# Load stored ip adresses from disk to CsConfig()
 config.set_address()
 
 logging.debug("Configuring ip addresses")
-# IP configuration
 config.address().compare()
 config.address().process()
 
-logging.debug("Configuring vmpassword")
-password = CsPassword("vmpassword", config)
-password.process()
+if process_file in ["cmd_line.json", "guest_network.json"]:
+logging.debug("Configuring Guest Network")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vm_password.json"]:
+logging.debug("Configuring vmpassword")
+password = CsPassword("vmpassword", config)
+password.process()
 
-logging.debug("Configuring vmdata")
-metadata = CsVmMetadata('vmdata', config)
-metadata.process()
+if process_file in ["cmd_line.json", "vm_metadata.json"]:
+logging.debug("Configuring vmdata")
+metadata = CsVmMetadata('vmdata', config)
+metadata.process()
 
-logging.debug("Configuring networkacl")
+# Always run both CsAcl().process() methods
+# They fill the base rules in config.fw[]
 acls = CsAcl('networkacl', config)
 acls.process()
 
-logging.debug("Configuring firewall rules")
 acls = CsAcl('firewallrules', config)
 acls.process()
 
-logging.debug("Configuring PF rules")
 fwd = CsForwardingRules("forwardingrules", config)
 fwd.process()
 
-logging.debug("Configuring s2s vpn")
 vpns = CsSite2SiteVpn("site2sitevpn", config)
 vpns.process()
 
-logging.debug("Configuring remote access vpn")
-#remote access vpn
 rvpn = CsRemoteAccessVpn("remoteaccessvpn", config)
 rvpn.process()
 
-logging.debug("Configuring vpn users list")
-#remote access vpn users
-vpnuser = CsVpnUser("vpnuserlist", config)
-vpnuser.process()
-
-logging.debug("Configuring dhcp entry")
-dhcp = CsDhcp("dhcpentry", config)
-dhcp.process()
-
-logging.debug("Configuring load balancer")
 lb = CsLoadBalancer("loadbalancer", config)
 lb.process()
 
-logging.debug("Configuring monitor service")
-mon = CsMonitor("monitorservice", config)
-mon.process()
+if process_file in ["cmd_line.json", "network_acl.json"]:
+logging.debug("Configuring networkacl")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "firewall_rules.json"]:
+logging.debug("Configuring firewall rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "forwarding_rules.json", 
"staticnat_rules.json"]:
+logging.debug("Configuring PF rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "site_2_site_vpn.json"]:
+logging.debug("Configuring s2s vpn")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "remote_access_vpn.json"]:
+logging.debug("Configuring remote access vpn")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vpn_user_list.json"]:
+logging.debug("Configuring vpn users list")
+vpnuser = CsVpnUser("vpnuserlist", config)
+vpnuser.process()
--- End diff --

Here, it is done as expected. The config file is checked, then it is 
logged, then the vpnuser.process gets executed.


---
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: Enhance VR performance

2016-01-20 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50259430
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
@@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
 
 
 def main(argv):
+# The file we are currently processing, if it is "cmd_line.json" 
everything will be processed.
+process_file = argv[1]
+
+# process_file can be None, if so assume cmd_line.json
+if process_file is None:
+process_file = "cmd_line.json"
+
+# Track if changes need to be committed to NetFilter
+iptables_change = False
+
+# The "GLOBAL" Configuration object
 config = CsConfig()
+
 logging.basicConfig(filename=config.get_logger(),
 level=config.get_level(),
 format=config.get_format())
+
+# Load stored ip adresses from disk to CsConfig()
 config.set_address()
 
 logging.debug("Configuring ip addresses")
-# IP configuration
 config.address().compare()
 config.address().process()
 
-logging.debug("Configuring vmpassword")
-password = CsPassword("vmpassword", config)
-password.process()
+if process_file in ["cmd_line.json", "guest_network.json"]:
+logging.debug("Configuring Guest Network")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "vm_password.json"]:
+logging.debug("Configuring vmpassword")
+password = CsPassword("vmpassword", config)
+password.process()
 
-logging.debug("Configuring vmdata")
-metadata = CsVmMetadata('vmdata', config)
-metadata.process()
+if process_file in ["cmd_line.json", "vm_metadata.json"]:
+logging.debug("Configuring vmdata")
+metadata = CsVmMetadata('vmdata', config)
+metadata.process()
 
-logging.debug("Configuring networkacl")
+# Always run both CsAcl().process() methods
+# They fill the base rules in config.fw[]
 acls = CsAcl('networkacl', config)
 acls.process()
 
-logging.debug("Configuring firewall rules")
 acls = CsAcl('firewallrules', config)
 acls.process()
 
-logging.debug("Configuring PF rules")
 fwd = CsForwardingRules("forwardingrules", config)
 fwd.process()
 
-logging.debug("Configuring s2s vpn")
 vpns = CsSite2SiteVpn("site2sitevpn", config)
 vpns.process()
 
-logging.debug("Configuring remote access vpn")
-#remote access vpn
 rvpn = CsRemoteAccessVpn("remoteaccessvpn", config)
 rvpn.process()
 
-logging.debug("Configuring vpn users list")
-#remote access vpn users
-vpnuser = CsVpnUser("vpnuserlist", config)
-vpnuser.process()
-
-logging.debug("Configuring dhcp entry")
-dhcp = CsDhcp("dhcpentry", config)
-dhcp.process()
-
-logging.debug("Configuring load balancer")
 lb = CsLoadBalancer("loadbalancer", config)
 lb.process()
 
-logging.debug("Configuring monitor service")
-mon = CsMonitor("monitorservice", config)
-mon.process()
+if process_file in ["cmd_line.json", "network_acl.json"]:
+logging.debug("Configuring networkacl")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "firewall_rules.json"]:
+logging.debug("Configuring firewall rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "forwarding_rules.json", 
"staticnat_rules.json"]:
+logging.debug("Configuring PF rules")
+iptables_change = True
+
+if process_file in ["cmd_line.json", "site_2_site_vpn.json"]:
+logging.debug("Configuring s2s vpn")
+iptables_change = True
--- End diff --

Here, it is misleading. The vpns.process has already been executed, then a 
log appears (configur*ing*)


---
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: Enhance VR performance

2016-01-20 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1346#discussion_r50259649
  
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py ---
@@ -96,29 +96,8 @@ def configure_server(self):
 self.conf.search(sline, line)
 
 def delete_leases(self):
-changed = []
-leases = []
 try:
-for line in open(LEASES):
-bits = line.strip().split(' ')
-to = {"device": bits[0],
-  "mac": bits[1],
-  "ip": bits[2],
-  "host": bits[3:],
-  "del": False
-  }
-changed.append(to)
-
-for v in changed:
-if v['mac'] == to['mac'] or v['ip'] == to['ip'] or 
v['host'] == to['host']:
-to['del'] = True
-leases.append(to)
-
-for o in leases:
-if o['del']:
-cmd = "dhcp_release eth%s %s %s" % (o['device'], 
o['ip'], o['mac'])
-logging.info(cmd)
-CsHelper.execute(cmd)
+open(LEASES, 'w').close()
--- End diff --

That clears that up then!


---
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: Set version to 4.9.0-SNAPSHOT in master b...

2016-01-26 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1369#issuecomment-175058378
  
Versions LGTM


---
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-9251: Fix issue in scale VM to...

2016-01-26 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1363#issuecomment-175089677
  
Code LGTM


---
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: Add ability to download templates in Swif...

2016-01-29 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1332#issuecomment-176825081
  
LGTM Tested with a XenServer host and Swift as secondary storage. Got the 
link and downloaded the template

https://cloud.githubusercontent.com/assets/2355044/12679915/ea6b1a40-c674-11e5-9a95-617ece9e1c33.png";>



---
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 Sync of template.properties in Swift

2016-02-03 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1331#issuecomment-179502626
  
Tested on local setup, the template.properties is now uploaded correctly 
LGTM


---
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: Quota

2015-10-11 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41709296
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
 ---
@@ -0,0 +1,132 @@
+//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.api.command;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.QuotaBalanceResponse;
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+import org.apache.cloudstack.api.response.QuotaStatementItemResponse;
+
+import com.cloud.user.Account;
+
+@APICommand(name = "quotaBalance", responseObject = 
QuotaStatementItemResponse.class, description = "Create a quota balance 
statement", since = "4.6.0", requestHasSensitiveInfo = false, 
responseHasSensitiveInfo = false)
+public class QuotaBalanceCmd extends BaseCmd {
--- End diff --

What about projects?


---
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: Quota

2015-10-11 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41709306
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
 ---
@@ -0,0 +1,132 @@
+//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.api.command;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.QuotaBalanceResponse;
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+import org.apache.cloudstack.api.response.QuotaStatementItemResponse;
+
+import com.cloud.user.Account;
+
+@APICommand(name = "quotaBalance", responseObject = 
QuotaStatementItemResponse.class, description = "Create a quota balance 
statement", since = "4.6.0", requestHasSensitiveInfo = false, 
responseHasSensitiveInfo = false)
+public class QuotaBalanceCmd extends BaseCmd {
+
+public static final Logger s_logger = 
Logger.getLogger(QuotaBalanceCmd.class);
+
+private static final String s_name = "quotabalanceresponse";
+
+@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, 
required = true, description = "Optional, Account Id for which statement needs 
to be generated")
+private String accountName;
+
+@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "Optional, If 
domain Id is given and the caller is domain admin then the statement is 
generated for domain.")
+private Long domainId;
+
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. Use -MM-dd as the date 
format, e.g. startDate=2009-06-03.")
+private Date endDate;
+
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start date range quota query. Use -MM-dd as the date format, 
e.g. startDate=2009-06-01.")
+private Date startDate;
+
+@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, 
entityType = AccountResponse.class, description = "List usage records for the 
specified account")
+private Long accountId;
+
+@Inject
+QuotaResponseBuilder _responseBuilder;
+
+public Long getAccountId() {
+return accountId;
+}
+
+public void setAccountId(Long accountId) {
+this.accountId = accountId;
+}
+
+public String getAccountName() {
+return accountName;
+}
+
+public void setAccountName(String accountName) {
+this.accountName = accountName;
+}
+
+public Long getDomainId() {
+return domainId;
+}
+
+public void setDomainId(Long domainId) {
+this.domainId = domainId;
+}
+
+public Date getEndDate() {
+return endDate == null ? null : 
_responseBuilder.startOfNextDay(endDate);
+}
+
+public void setEndDate(Date endDate) {
+this.endDate = endDate;
+}
+
+public Date getStartDate() {
+return startDate;
+}
+
+public void setStartDate(Date startDate) {
+this.startDate = startDate;
+}
+
+@Override
+public String getCommandName() {
+return s_name;
+}
+
+@Override
 

[GitHub] cloudstack pull request: Quota

2015-10-11 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41709314
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
 ---
@@ -0,0 +1,147 @@
+//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.api.command;
+
+import com.cloud.user.Account;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.QuotaCreditsResponse;
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.quota.QuotaService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "quotaCredits", responseObject = 
QuotaCreditsResponse.class, description = "Add +-credits to an account", since 
= "4.6.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class QuotaCreditsCmd extends BaseCmd {
+
+@Inject
+QuotaResponseBuilder _responseBuilder;
+
+@Inject
+QuotaService _quotaService;
+
+public static final Logger s_logger = 
Logger.getLogger(QuotaStatementCmd.class);
+
+private static final String s_name = "quotacreditsresponse";
+
+@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, 
required = true, description = "Account Id for which quota credits need to be 
added")
+private String accountName;
+
+@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "Domain for 
which quota credits need to be added")
+private Long domainId;
+
+@Parameter(name = ApiConstants.VALUE, type = CommandType.DOUBLE, 
required = true, description = "Value of the credits to be added+, subtracted-")
+private Double value;
+
+@Parameter(name = "min_balance", type = CommandType.DOUBLE, required = 
false, description = "Minimum balance threshold of the account")
+private Double minBalance;
+
+@Parameter(name = "quota_enforce", type = CommandType.BOOLEAN, 
required = false, description = "Account for which quota enforce is set to 
false will not be locked when there is no credit balance")
+private Boolean quotaEnforce;
+
+public Double getMinBalance() {
+return minBalance;
+}
+
+public void setMinBalance(Double minBalance) {
+this.minBalance = minBalance;
+}
+
+public Boolean getQuotaEnforce() {
+return quotaEnforce;
+}
+
+public void setQuotaEnforce(Boolean quotaEnforce) {
+this.quotaEnforce = quotaEnforce;
+}
+
+public String getAccountName() {
+return accountName;
+}
+
+public void setAccountName(String accountName) {
+this.accountName = accountName;
+}
+
+public Long getDomainId() {
+return domainId;
+}
+
+public void setDomainId(Long domainId) {
+this.domainId = domainId;
+}
+
+public Double getValue() {
+return value;
+}
+
+public void setValue(Double value) {
+this.value = value;
+}
+
+public QuotaCreditsCmd() {
+super();
+}
+
+@Override
+public String getCommandName() {
+return s_name;
+}
+
+@Override
+public void execute() {
+Long accountId = nul

[GitHub] cloudstack pull request: Quota

2015-10-11 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41709319
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
 ---
@@ -0,0 +1,147 @@
+//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.api.command;
+
+import com.cloud.user.Account;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.QuotaCreditsResponse;
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.quota.QuotaService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "quotaCredits", responseObject = 
QuotaCreditsResponse.class, description = "Add +-credits to an account", since 
= "4.6.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class QuotaCreditsCmd extends BaseCmd {
--- End diff --

What about projects?


---
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-8793 Enable s2s VPN connection...

2015-10-13 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/879#issuecomment-147741954
  
Hey guys, 
I have been re-pushing the branch for it to build on Jenkins. It has been 
failing, but it doesn't seem to be related to my fixes (it seems like Jenkins 
issues). It finally worked

To test the fix:
1. Create a project
2. Create 2 vpcs (A and B)
3. Create a VPN gateway on each vpc
4. Create 2 customer gateways (pointing to each vpc's CIDR and vpn gateway)
5. Create a passive vpn connection from A to B
6. Create an active vpn connection form B to A
7. You can now ssh from A to B, or B to A



---
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: Corrected sentence

2015-10-19 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/951#issuecomment-149214174
  
LGTM


---
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-8793 Enable s2s VPN connection...

2015-10-19 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/879#issuecomment-149215099
  
Bump


---
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-8985: Deleted volume's removed...

2015-10-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/968#issuecomment-150575383
  
The fix looks like it will work, but it seems like it is just a workaround. 
Shouldn't the column be updated correctly instead?

Either in this method or the other one :

deleteSolidFireVolume(sfConnection, volumeInfo);
_volumeDetailsDao.removeDetails(volumeId);


---
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-8985: Deleted volume's removed...

2015-10-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/968#issuecomment-150675450
  
@mike-tutkowski Thanks. That makes more sense now. So concurrent deletions 
would still be a problem?


---
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-8793 Enable s2s VPN connection...

2015-10-28 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/879#issuecomment-151854916
  
@remibergsma I rebased and repushed. I will take some screen shots later! 
Thanks!


---
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-8793 Enable s2s VPN connection...

2015-10-29 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/879#issuecomment-152300355
  
@remibergsma The commit didn't change, I just rebased


---
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-9048: Fix typo for public netw...

2015-11-09 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1051#issuecomment-155183148
  
LGTM


---
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: [WIP] CLOUDSTACK-6276: project support in...

2015-11-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/508#issuecomment-157754858
  
Hey @wilderrodrigues @resmo,

I was looking to fixing this as well. Is there any way I can contribute? 
What is the status of this?

Thanks,
pdube


---
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: [WIP] CLOUDSTACK-6276: project support in...

2015-11-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/508#issuecomment-157854104
  
@ustcweizhou I have checked it out into another branch. I am working on it. 
And will create a PR when I am done. 


---
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: [WIP] CLOUDSTACK-6276: project support in...

2015-11-18 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/508#issuecomment-157874321
  
@ustcweizhou Also if you have a fix for it, why not port it forward?


---
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: [WIP] CLOUDSTACK-6276: project support in...

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

https://github.com/apache/cloudstack/pull/508#issuecomment-158075714
  
@ustcweizhou I am working on it now, but have a few questions about 
resource ownership


---
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: [WIP] CLOUDSTACK-6276: project support in...

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

https://github.com/apache/cloudstack/pull/508#issuecomment-158200813
  
Why is that access control done differently?


---
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: [WIP] CLOUDSTACK-6276: project support in...

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

https://github.com/apache/cloudstack/pull/508#issuecomment-158200709
  
@ustcweizhou Is that actually necessary?


---
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: [WIP] CLOUDSTACK-6276: project support in...

2015-11-20 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/508#issuecomment-158434572
  
@ustcweizhou  Thanks for the response. I understand the code. I was 
wondering why there was a need for a special access checker for AffinityGroups. 
After more investigation, it seems like the DomainChecker explicitly fails for 
affinity groups, which seems a bit strange. 


---
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: CID-1339965 handle retrun value on failur...

2015-11-26 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1129#discussion_r46006607
  
--- Diff: 
services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
 ---
@@ -558,7 +558,9 @@ public String downloadPublicTemplate(long id, String 
url, String name, ImageForm
 ResourceType.TEMPLATE == resourceType ? 
_storage.getFile(tmpDir + File.separator + TemplateLocation.Filename) : 
_storage.getFile(tmpDir + File.separator +
 "volume.properties");
 if (file.exists()) {
-file.delete();
+if(! file.delete()) {
+s_logger.warn("delete of file '" + 
file.getAbsolutePath() + "' failed.");
--- End diff --

Deletion*


---
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: CID-1339965 handle retrun value on failur...

2015-11-26 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1129#issuecomment-159993684
  
LGTM, on code review


---
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: Reducing expunge delay and interval on de...

2015-11-27 Thread pdube
GitHub user pdube opened a pull request:

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

Reducing expunge delay and interval on default dev cfgs

Significantly reduces the time it takes to execute the integration tests

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

$ git pull https://github.com/pdube/cloudstack 4.6

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

https://github.com/apache/cloudstack/pull/1135.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 #1135


commit 2bbe7d321ac535bbc2701ccf27ee7d25fa02ca52
Author: Patrick Dube 
Date:   2015-11-27T20:57:15Z

Reducing expunge delay and interval by default on dev cfgs




---
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: Reducing expunge delay and interval on de...

2015-11-28 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1135#issuecomment-160353791
  
I will check it out!


---
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-6276 Fixing affinity groups fo...

2015-11-28 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1134#discussion_r46086641
  
--- Diff: test/integration/component/test_affinity_groups_projects.py ---
@@ -0,0 +1,1083 @@
+#!/usr/bin/env python
+#  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.
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackAPI import deleteAffinityGroup
+from marvin.lib.utils import (cleanup_resources,
+random_gen)
+from marvin.lib.base import (Account,
+Project,
+ServiceOffering,
+VirtualMachine,
+AffinityGroup,
+Domain)
+from marvin.lib.common import (get_zone,
+ get_domain,
+ get_template,
+ list_hosts,
+ list_virtual_machines,
+ wait_for_cleanup)
+from nose.plugins.attrib import attr
+
+class Services:
+"""Test Account Services
+"""
+
+def __init__(self):
+   self.services = {
+  "domain": {
+ "name": "NonRootDomain"
+  },
+  "domain_admin_account": {
+ "email": "newt...@test.com",
+ "firstname": "Test",
+ "lastname": "User",
+ "username": "doadmintest",
+ "password": "password"
+  },
+  "account": {
+ "email": "newt...@test.com",
+ "firstname": "Test",
+ "lastname": "User",
+ "username": "acc",
+ "password": "password"
+  },
+  "account_not_in_project": {
+ "email": "newt...@test.com",
+ "firstname": "Test",
+ "lastname": "User",
+ "username": "account_not_in_project",
+ "password": "password"
+  },
+  "project": {
+ "name": "Project",
+ "displaytext": "Project"
+  },
+  "project2": {
+ "name": "Project2",
+ "displaytext": "Project2"
+  },
+  "service_offering": {
+ "name": "Tiny Instance",
+ "displaytext": "Tiny Instance",
+ "cpunumber": 1,
+ "cpuspeed": 100,
+ "memory": 64
+  },
+  "ostype": 'CentOS 5.3 (64-bit)',
+  "host_anti_affinity": {
+"name": "",
+"type": "host anti-affinity"
+ },
+  "virtual_machine" : {
+ "hypervisor" : "KVM"
--- End diff --

It is actually unused in the api call. I will remove it. 


---
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-6276 Fixing affinity groups fo...

2015-11-29 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-160441642
  
@DaanHoogland I did not find a guide to do it. I looked at the patterns I 
found in other modules, and imitated those. I found it confusing because there 
were a few different ways to do it. I really don't mind moving it back into the 
service. As a side question, why not move it into the AffinityGroupDao? (if 
not, what is the Dao for?) Is there a definitive guide for writing APIs? If 
there is not a definitive guide, then maybe we should write one to help with 
the evolution of the APIs


---
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-6276 Fixing affinity groups fo...

2015-11-29 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-160447903
  
@DaanHoogland I was talking about the implementation of APIs. Example, 
let's say you create a new module, call it Exampe. So we can list, create and 
delete Example. What are the classes that we expect someone to create? 
ExampleService, ExampleDoa, ExampleVO, etc.? That is what I was refering to. 
That way, if we decide that the best way to write modules is to have a service 
that is self contained, then we can phase out the use of the QueryService


---
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-6276 Fixing affinity groups fo...

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-160638862
  
@DaanHoogland Ok, I understand what you mean. I do think that we need some 
clarifications on what the standards are (search vs list, service vs query vs 
dao, etc.) PS: I was not taking it that way :)


---
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: Show Agent name in Ping response

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1143#issuecomment-160674157
  
LGTM, but consider using the default log4j formatter. ex:
`logger.debug("Ping from {} ({})", hostid, hostname);`
and extracting the message to a constant


---
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: Show Agent name in Ping response

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1143#issuecomment-160684591
  
@wido :)


---
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: Update L10N resource files with 4.6 strin...

2015-11-30 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1138#discussion_r46184167
  
--- Diff: client/WEB-INF/classes/resources/messages_fr_FR.properties ---
@@ -1739,7 +1740,7 @@ message.action.enable.nexusVswitch=Confirmer 
l\\'activation de ce Nexus 1000v
 message.action.enable.physical.network=Confirmer l\\'activation de ce 
r\u00e9seau physique.
 message.action.enable.pod=Activer ce pod ?
 message.action.enable.zone=Activer cette zone ?
-message.action.expunge.instance=Confirmez que vous souhaitez oruger cette 
instance.
+message.action.expunge.instance=Confirmez que vous souhaitez effacer cette 
instance.
--- End diff --

purger?


---
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: Update L10N resource files with 4.6 strin...

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1138#issuecomment-160720589
  
Suggested a small french change, but still LGTM


---
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: Update L10N resource files with 4.6 strin...

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1138#issuecomment-160721861
  
@remibergsma Fine with me


---
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: [4.6.1] CLOUDSTACK-9022: keep Destroyed v...

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1144#issuecomment-160739865
  
Hey @ustcweizhou, could you create the PR towards 4.6 please, it is hard to 
determine exactly what you changed. Thanks


---
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: make sure all files are updates with new ...

2015-11-30 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1146#discussion_r46204918
  
--- Diff: tools/build/build_asf.sh ---
@@ -101,6 +101,11 @@ perl -pi -e "s/-SNAPSHOT//" build/replace.properties
 perl -pi -e "s/-SNAPSHOT//" services/console-proxy/plugin/pom.xml
 perl -pi -e "s/-SNAPSHOT//" tools/marvin/setup.py
 perl -pi -e "s/-SNAPSHOT//" tools/marvin/marvin/deployAndRun.py
+perl -pi -e "s/-SNAPSHOT//" debian/changelog
+perl -pi -e "s/-SNAPSHOT//" services/iam/plugin/pom.xml
+perl -pi -e "s/-SNAPSHOT//" services/iam/pom.xm
+perl -pi -e "s/-SNAPSHOT//" services/iam/server/pom.xml
--- End diff --

Why do you have to add these manually? What about the other folders in 
/services?


---
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: make sure all files are updates with new ...

2015-11-30 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1146#discussion_r46204974
  
--- Diff: tools/build/build_asf.sh ---
@@ -123,11 +128,7 @@ git clean -f
 
 #create a RC branch
 RELEASE_BRANCH="RC"`date +%Y%m%dT%H%M`
--- End diff --

Might be clearer to name this variable RC_BRANCH_SUFFIX


---
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:

2015-11-30 Thread pdube
Github user pdube commented on the pull request:


https://github.com/apache/cloudstack/commit/7d7420fd1e5908e1bc4ee04a314241212f7a6481#commitcomment-14693674
  
+1


---
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: make sure all files are updates with new ...

2015-11-30 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1146#issuecomment-160765582
  
Ok then, LGTM


---
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-6276 Fixing affinity groups fo...

2015-12-01 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-160978139
  
@resmo @ustcweizhou @remibergsma Any news on testing? LGTY?


---
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-6276 Fixing affinity groups fo...

2015-12-03 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1134#discussion_r46553780
  
--- Diff: 
server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java ---
@@ -229,59 +205,99 @@ public AffinityGroupVO 
doInTransaction(TransactionStatus status) {
 return group;
 }
 });
+}
 
-if (s_logger.isDebugEnabled()) {
-s_logger.debug("Created affinity group =" + affinityGroupName);
+private DomainVO getDomain(Long domainId) {
+DomainVO domain = _domainDao.findById(domainId);
+if (domain == null) {
+throw new InvalidParameterValueException("Unable to find 
domain by specified id");
 }
+return domain;
+}
 
-return group;
+private void verifyAffinityGroupNameInUse(long accountId, long 
domainId, String affinityGroupName) {
+if (_affinityGroupDao.isNameInUse(accountId, domainId, 
affinityGroupName)) {
+throw new InvalidParameterValueException("Unable to create 
affinity group, a group with name " + affinityGroupName + " already exists.");
+}
+}
+
+private void verifyDomainLevelAffinityGroupName(boolean domainLevel, 
long domainId, String affinityGroupName) {
+if (domainLevel && 
_affinityGroupDao.findDomainLevelGroupByName(domainId, affinityGroupName) != 
null) {
+throw new InvalidParameterValueException("Unable to create 
affinity group, a group with name " + affinityGroupName + " already exists 
under the domain.");
+}
 }
 
 @DB
-@Override
 @ActionEvent(eventType = EventTypes.EVENT_AFFINITY_GROUP_DELETE, 
eventDescription = "Deleting affinity group")
-public boolean deleteAffinityGroup(Long affinityGroupId, String 
account, Long domainId, String affinityGroupName) {
+public boolean deleteAffinityGroup(Long affinityGroupId, String 
account, Long projectId, Long domainId, String affinityGroupName) {
+
+AffinityGroupVO group = getAffinityGroup(affinityGroupId, account, 
projectId, domainId, affinityGroupName);
 
+// check permissions
 Account caller = CallContext.current().getCallingAccount();
-Account owner = _accountMgr.finalizeOwner(caller, account, 
domainId, null);
+_accountMgr.checkAccess(caller, AccessType.OperateEntry, true, 
group);
--- End diff --

I think that if a user is able to create an AG, then he should be able to 
delete it


---
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-9087:adding projectid paramete...

2015-12-03 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1153#issuecomment-161650382
  
Isn't the project inferred from the instance? The 
[CreateVmSnapshot](http://cloudstack.apache.org/docs/api/apidocs-4.6/root_admin/createVMSnapshot.html)
 API doesn't even take a projectId


---
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-6276 Fixing affinity groups fo...

2015-12-03 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-161657343
  
Hey guys, there are enough LGTMs, can we get this merged?


---
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-6276 Fixing affinity groups fo...

2015-12-03 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1134#issuecomment-161775836
  
@remibergsma  awesome :)


---
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: 4.6.0 upgrade path is to pass 4.6.1 to cr...

2015-12-04 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1173#discussion_r46685020
  
--- Diff: setup/db/db/schema-460to470.sql ---
@@ -1,32 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
---   http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing,
--- software distributed under the License is distributed on an
--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
--- KIND, either express or implied.  See the License for the
--- specific language governing permissions and limitations
--- under the License.
-
---;
--- Schema upgrade from 4.6.0 to 4.7.0;
---;
-
-CREATE TABLE IF NOT EXISTS `cloud`.`domain_vlan_map` (
--- End diff --

Is this in the 4.6.0 to 4.6.1?


---
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-9087:adding projectid paramete...

2015-12-04 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1153#issuecomment-161978474
  
@nitt10prashant No problemo


---
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: 4.6.0 upgrade path is to pass 4.6.1 to cr...

2015-12-04 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/1173#issuecomment-161987586
  
LGTM by code review. 


---
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: Fixed box location on vagrant files

2015-09-22 Thread pdube
GitHub user pdube opened a pull request:

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

Fixed box location on vagrant files

The centos-6.5 is no longer available

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

$ git pull https://github.com/pdube/cloudstack CLOUDSTACK-8898

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

https://github.com/apache/cloudstack/pull/875.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 #875


commit 3f8f6eb7909040556d1df257914f8bd2f813711b
Author: Patrick Dube 
Date:   2015-09-22T19:04:01Z

Fixed box location on vagrant files




---
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: Fixed box location on vagrant files for d...

2015-09-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/875#issuecomment-142596258
  
Thank you @pdion891 @karuturi. Fixed in the last commit


---
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: [4.6][BLOCKER]CLOUDSTACK-8890: Added isEm...

2015-09-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/878#issuecomment-142601843
  
This looks good, but does this have an impact elsewhere? Did you test 
listing vms by user_id?


---
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: [4.6][BLOCKER]CLOUDSTACK-8890: Added isEm...

2015-09-23 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/878#issuecomment-142606607
  
@borisroman True, LGTM


---
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-8793 Enable s2s VPN connection...

2015-09-23 Thread pdube
GitHub user pdube opened a pull request:

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

CLOUDSTACK-8793 Enable s2s VPN connection for projects



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

$ git pull https://github.com/pdube/cloudstack CLOUDSTACK-8793

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

https://github.com/apache/cloudstack/pull/879.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 #879


commit b3d631a5ad2490db4bd1869862b44907cb02d21e
Author: Patrick Dube 
Date:   2015-09-23T15:21:43Z

CLOUDSTACK-8793 Added project id to create vpn customer gateway, and to the 
impl of list vpn connections and list vpn customer gateways




---
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: Use java.io.tmpdir instead of hardcoded /...

2015-09-24 Thread pdube
Github user pdube commented on the pull request:

https://github.com/apache/cloudstack/pull/884#issuecomment-142936013
  
LGTM


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-02 Thread pdube
GitHub user pdube opened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581






---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-03 Thread pdube
Github user pdube commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1581#discussion_r65701961
  
--- Diff: 
core/test/com/cloud/agent/api/routing/SetNetworkACLCommandTest.java ---
@@ -0,0 +1,34 @@
+package com.cloud.agent.api.routing;
--- End diff --

Thanks, updated it


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-03 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-03 Thread pdube
Github user pdube closed the pull request at:

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


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL rules ...

2016-06-04 Thread pdube
Github user pdube commented on the issue:

https://github.com/apache/cloudstack/pull/1581
  
@pdube Travis timed out, you may want to try the Travis Lottery again ;-)

Is this ready for testing?


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-06 Thread pdube
Github user pdube closed the pull request at:

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


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-06 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL rules ...

2016-06-06 Thread pdube
Github user pdube commented on the issue:

https://github.com/apache/cloudstack/pull/1581
  
@remibergsma Yes, the rules should appear in the right order now.


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL rules ...

2016-06-06 Thread pdube
Github user pdube commented on the issue:

https://github.com/apache/cloudstack/pull/1581
  
The Travis build has timed out 3 times now. Is there any known issue with 
Travis right now @swill ?


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-06 Thread pdube
Github user pdube closed the pull request at:

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


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-06 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-08 Thread pdube
Github user pdube closed the pull request at:

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


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-08 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL rules ...

2016-06-10 Thread pdube
Github user pdube commented on the issue:

https://github.com/apache/cloudstack/pull/1581
  
Thanks @dmabry


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-10 Thread pdube
Github user pdube closed the pull request at:

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


---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-10 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




---
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 #1581: CLOUDSTACK-9404 Fixed ordering of network ACL...

2016-06-13 Thread pdube
GitHub user pdube reopened a pull request:

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

CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR.

 The comparator was inverted.

Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404

In this example, I created rules with the port numbers the same as the rule 
numbers.

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   all  --  anywhere anywhere

We can see above that the rules are inverted.

After the fix:

Chain ACL_INBOUND_eth2 (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere 225.0.0.50
ACCEPT all  --  anywhere vrrp.mcast.net
DROP   tcp  --  anywhere anywhere tcp dpt:2
DROP   tcp  --  anywhere anywhere tcp dpt:3
DROP   tcp  --  anywhere anywhere tcp dpt:5
DROP   tcp  --  anywhere anywhere tcp dpt:10
DROP   tcp  --  anywhere anywhere tcp 
dpt:netstat
DROP   all  --  anywhere anywhere


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

$ git pull https://github.com/pdube/cloudstack network-acl-rules-order

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

https://github.com/apache/cloudstack/pull/1581.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 #1581


commit caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Author: Patrick Dube 
Date:   2016-06-02T17:15:38Z

Fixed ordering of network ACL rules being sent to the VR. The comparator 
was inverted

commit 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Author: Patrick Dube 
Date:   2016-06-02T17:44:39Z

Added unit test to verify ordering

commit 9cdd23fdc77e643d886c3af8cb0a60f9c4ddf84f
Author: Patrick Dube 
Date:   2016-06-03T12:48:47Z

Added ASF license to unit test file




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


  1   2   >