Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9ACE517DB3 for ; Thu, 25 Sep 2014 17:31:58 +0000 (UTC) Received: (qmail 50952 invoked by uid 500); 25 Sep 2014 17:31:58 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 50923 invoked by uid 500); 25 Sep 2014 17:31:58 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 50914 invoked by uid 99); 25 Sep 2014 17:31:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2014 17:31:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 24919914A8C; Thu, 25 Sep 2014 17:31:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: frankzhang@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 44a4158 Date: Thu, 25 Sep 2014 17:31:58 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master 410092bbe -> 44a4158c4 CLOUDSTACK-6278 Baremetal Advanced Networking support Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/44a4158c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/44a4158c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/44a4158c Branch: refs/heads/master Commit: 44a4158c4854d85e4c234655e375fe0c631507d5 Parents: 410092b Author: Frank Zhang Authored: Thu Sep 25 10:35:33 2014 -0700 Committer: Frank Zhang Committed: Thu Sep 25 10:35:49 2014 -0700 ---------------------------------------------------------------------- .../networkservice/BaremetalKickStartServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/44a4158c/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java index 3b88ca6..16fc460 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java @@ -160,15 +160,20 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase imple return Arrays.asList(ks, kernel, initrd); } - private File getSystemVMKeyFile() { + public File getSystemVMKeyFile() { URL url = this.getClass().getClassLoader().getResource("scripts/vm/systemvm/id_rsa.cloud"); File keyFile = null; if (url != null) { keyFile = new File(url.getPath()); } - if (keyFile == null || !keyFile.canRead()) { - s_logger.error("Unable to locate id_rsa.cloud"); - return null; + if (keyFile == null || !keyFile.exists()) { + keyFile = new File("/usr/share/cloudstack-common/scripts/vm/systemvm/id_rsa.cloud"); + } + if (!keyFile.exists()) { + throw new CloudRuntimeException(String.format("cannot find id_rsa.cloud")); + } + if (!keyFile.exists()) { + s_logger.error("Unable to locate id_rsa.cloud in your setup at " + keyFile.toString()); } return keyFile; }