cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject [1/5] git commit: updated refs/heads/4.2 to 4918e21
Date Thu, 14 Nov 2013 03:03:36 GMT
Updated Branches:
  refs/heads/4.2 fcb806a6a -> 4918e2145


Revert "Accidentally checked in the wrong file"

This reverts commit 1c3b9b53fe0c1455b783e1cdd21768a0a9b734cb.


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

Branch: refs/heads/4.2
Commit: a9f473ee5d3a8b89168911c84903171bea5a0285
Parents: fcb806a
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Nov 13 18:59:43 2013 -0800
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Nov 13 18:59:43 2013 -0800

----------------------------------------------------------------------
 .../hypervisor/xenserver/xenserver60/NFSSR.py   | 64 +++++++++-----------
 1 file changed, 29 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a9f473ee/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py b/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py
index 0d6badb..d0c98a1 100755
--- a/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py
+++ b/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py
@@ -1,21 +1,16 @@
 #!/usr/bin/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.
-
+# Copyright (C) 2006-2007 XenSource Ltd.
+# Copyright (C) 2008-2009 Citrix Ltd.
+#
+# This program is free software; you can redistribute it and/or modify 
+# it under the terms of the GNU Lesser General Public License as published 
+# by the Free Software Foundation; version 2.1 only.
+#
+# This program is distributed in the hope that it will be useful, 
+# but WITHOUT ANY WARRANTY; without even the implied warranty of 
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+# GNU Lesser General Public License for more details.
+#
 # FileSR: local-file storage repository
 
 import SR, VDI, SRCommand, FileSR, util
@@ -42,8 +37,8 @@ CONFIGURATION = [ [ 'server', 'hostname or IP address of NFS server (required)'
 DRIVER_INFO = {
     'name': 'NFS VHD',
     'description': 'SR plugin which stores disks as VHD files on a remote NFS filesystem',
-    'vendor': 'The Apache Software Foundation',
-    'copyright': 'Copyright (c) 2012 The Apache Software Foundation',
+    'vendor': 'Citrix Systems Inc',
+    'copyright': '(C) 2008 Citrix Systems Inc',
     'driver_version': '1.0',
     'required_api_version': '1.0',
     'capabilities': CAPABILITIES,
@@ -112,8 +107,7 @@ class NFSSR(FileSR.FileSR):
 
     def attach(self, sr_uuid):
         self.validate_remotepath(False)
-        #self.remotepath = os.path.join(self.dconf['serverpath'], sr_uuid)
-        self.remotepath = self.dconf['serverpath']
+        self.remotepath = os.path.join(self.dconf['serverpath'], sr_uuid)
         util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
         self.mount_remotepath(sr_uuid)
 
@@ -181,20 +175,20 @@ class NFSSR(FileSR.FileSR):
                 pass
             raise exn
 
-        #newpath = os.path.join(self.path, sr_uuid)
-        #if util.ioretry(lambda: util.pathexists(newpath)):
-        #    if len(util.ioretry(lambda: util.listdir(newpath))) != 0:
-        #        self.detach(sr_uuid)
-        #        raise xs_errors.XenError('SRExists')
-        #else:
-        #    try:
-        #        util.ioretry(lambda: util.makedirs(newpath))
-        #    except util.CommandException, inst:
-        #        if inst.code != errno.EEXIST:
-        #            self.detach(sr_uuid)
-        #            raise xs_errors.XenError('NFSCreate', 
-        #                opterr='remote directory creation error is %d' 
-        #                % inst.code)
+        newpath = os.path.join(self.path, sr_uuid)
+        if util.ioretry(lambda: util.pathexists(newpath)):
+            if len(util.ioretry(lambda: util.listdir(newpath))) != 0:
+                self.detach(sr_uuid)
+                raise xs_errors.XenError('SRExists')
+        else:
+            try:
+                util.ioretry(lambda: util.makedirs(newpath))
+            except util.CommandException, inst:
+                if inst.code != errno.EEXIST:
+                    self.detach(sr_uuid)
+                    raise xs_errors.XenError('NFSCreate', 
+                        opterr='remote directory creation error is %d' 
+                        % inst.code)
         self.detach(sr_uuid)
 
     def delete(self, sr_uuid):


Mime
View raw message