Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7368D4C3 for ; Tue, 25 Sep 2012 00:38:40 +0000 (UTC) Received: (qmail 50568 invoked by uid 500); 25 Sep 2012 00:38:40 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 50505 invoked by uid 500); 25 Sep 2012 00:38:40 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 50461 invoked by uid 99); 25 Sep 2012 00:38:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 00:38:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 079CD3B2E9; Tue, 25 Sep 2012 00:38:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chipchilders@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [3/13] git commit: CLOUDSTACK-184: add createFileInDomr plugin Message-Id: <20120925003840.079CD3B2E9@tyr.zones.apache.org> Date: Tue, 25 Sep 2012 00:38:40 +0000 (UTC) CLOUDSTACK-184: add createFileInDomr plugin Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/acaa2200 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/acaa2200 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/acaa2200 Branch: refs/heads/junit-tests Commit: acaa22003df7b60abdf48d53b09147a660d15dfd Parents: a3c80eb Author: Anthony Xu Authored: Mon Sep 24 16:11:04 2012 -0700 Committer: Anthony Xu Committed: Mon Sep 24 16:11:04 2012 -0700 ---------------------------------------------------------------------- scripts/vm/hypervisor/xenserver/vmops | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/acaa2200/scripts/vm/hypervisor/xenserver/vmops ---------------------------------------------------------------------- diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops index e3f3e33..21c73ac 100755 --- a/scripts/vm/hypervisor/xenserver/vmops +++ b/scripts/vm/hypervisor/xenserver/vmops @@ -361,6 +361,26 @@ def createFile(session, args): return txt @echo +def createFileInDomr(session, args): + file_path = args['filepath'] + file_contents = args['filecontents'] + domrip = args['domrip'] + try: + tmpfile = util.pread2(['mktemp']).strip() + f = open(tmpfile, "w") + f.write(file_contents) + f.close() + target = "root@" + domrip + ":" + file_path + util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud',tmpfile, target]) + util.pread2(['rm',tmpfile]) + txt = 'success' + except: + util.SMlog(" failed to create HA proxy cfg file ") + txt = '' + + return txt + +@echo def deleteFile(session, args): file_path = args["filepath"] @@ -1452,4 +1472,5 @@ if __name__ == "__main__": "setLinkLocalIP":setLinkLocalIP, "cleanup_rules":cleanup_rules, "bumpUpPriority":bumpUpPriority, + "createFileInDomr":createFileInDomr, "kill_copy_process":kill_copy_process})