You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/11/11 14:38:05 UTC

[1/2] stratos git commit: Make PCA extension output as a DEBUG log

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 1f86d2faa -> e852d768a


Make PCA extension output as a DEBUG log


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/bbfbd4d8
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/bbfbd4d8
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/bbfbd4d8

Branch: refs/heads/stratos-4.1.x
Commit: bbfbd4d820c7fdfde12f990aa6967e8784effa14
Parents: 1f86d2f
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Nov 11 18:15:31 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Nov 11 18:15:31 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/extensions/py/ExtensionExecutor.py             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfbd4d8/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
index 7a5258e..3548e4a 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
@@ -41,7 +41,7 @@ class ExtensionExecutor(ICartridgeAgentPlugin):
         if len(errors) > 0:
             raise RuntimeError("Extension execution failed for script %s: %s" % (event_name, errors))
 
-        log.info("%s Extension executed. [output]: %s" % (event_name, output))
+        log.debug("%s Extension executed. [output]: %s" % (event_name, output))
 
     @staticmethod
     def execute_script(bash_file, extension_values):


[2/2] stratos git commit: Use is_dirty method to check working dir status in PCA artifact commit plugin. Artifact commit method should return if not a valid repo

Posted by ra...@apache.org.
Use is_dirty method to check working dir status in PCA artifact commit plugin. Artifact commit method should return if not a valid repo


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e852d768
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e852d768
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e852d768

Branch: refs/heads/stratos-4.1.x
Commit: e852d768a6a61618d450ed337a4fe5d115bd8910
Parents: bbfbd4d
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Nov 11 19:07:44 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Nov 11 19:07:44 2015 +0530

----------------------------------------------------------------------
 .../plugins/DefaultArtifactCommit.py               | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e852d768/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCommit.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCommit.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCommit.py
index c9f5dd0..4172a87 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCommit.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCommit.py
@@ -15,13 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from plugins.contracts import IArtifactCommitPlugin
-from modules.util.log import LogFactory
-from modules.artifactmgt.git.agentgithandler import AgentGitHandler
-from config import Config
-import constants
 from exception import *
 from git import *
+from modules.artifactmgt.git.agentgithandler import AgentGitHandler
+from plugins.contracts import IArtifactCommitPlugin
+
+from modules.util.log import LogFactory
 
 
 class DefaultArtifactCommit(IArtifactCommitPlugin):
@@ -43,7 +42,9 @@ class DefaultArtifactCommit(IArtifactCommitPlugin):
         if git_repo is None:
             # not cloned yet
             AgentGitHandler.log.error("Not a valid repository to push from. Aborting Git push...")
+            return
 
+        repo = Repo(git_repo.local_repo_path)
         # Get initial HEAD so in case if push fails it can be reverted to this hash
         # This way, commit and push becomes an single operation. No intermediate state will be left behind.
         (init_head, init_errors) = AgentGitHandler.execute_git_command(["rev-parse", "HEAD"], git_repo.local_repo_path)
@@ -58,10 +59,7 @@ class DefaultArtifactCommit(IArtifactCommitPlugin):
             AgentGitHandler.log.error("Git could not stage untracked artifacts")
 
         # check for changes in working directory
-        modified = AgentGitHandler.has_modified_files(git_repo.local_repo_path)
-
-        AgentGitHandler.log.debug("[Git] Modified: %s" % str(modified))
-        if not modified:
+        if not repo.is_dirty():
             AgentGitHandler.log.debug("No changes detected in the local repository for tenant %s" % git_repo.tenant_id)
             return
 
@@ -88,7 +86,6 @@ class DefaultArtifactCommit(IArtifactCommitPlugin):
             AgentGitHandler.execute_git_command(["reset", "--hard", init_head], git_repo.local_repo_path)
             return
 
-        repo = Repo(git_repo.local_repo_path)
         # pull and rebase before pushing to remote repo
         AgentGitHandler.execute_git_command(["pull", "--rebase", "origin", "master"], git_repo.local_repo_path)
         if repo.is_dirty():