GitHub user alexandrelimassantana opened a pull request:

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

    Undetected bug correct and refactor of the class NfsSecondaryStorageResource

    Im in process of rewriting the unit test for this class' mount method. 
Before I can do that, the class needed some refactoring, not just because it 
was fuzzy but because it was impossible to use mocks the way it was coded. Most 
of this PR is about transforming big chunks of code into documented methods 
with two exceptions:
    
    1) I inverted the logic when checking for existing mounts within the same 
root location. Previously one would first create a directory if it didn't exist 
and then test if there was already mount there. Now it is first testing if 
there is a mount, if not, it creates the needed directory.
    
    2) A bug was found in the unmount method. The unmount wasn't issuing the 
command "umount" to unmount a resource but instead was trying the "mount" 
command again, resulting in mounted resources never being unmounted.

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

    $ git pull https://github.com/rafaelweingartner/cloudstack 
lrg-cs-hackday-046

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

    https://github.com/apache/cloudstack/pull/1499.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 #1499
    
----
commit d85810d122ec9f5c697ad77f6a5422e50ac718da
Author: Alexandre Limas Santana <alexandre.limas.sant...@gmail.com>
Date:   2016-04-16T20:49:49Z

    Refactor of the class NfsSecondaryStorageResource withing the domain of
    the mount process. A bug was found and corrected in the function unmount

----


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

Reply via email to