~ubuntu-branches/ubuntu/wily/manila/wily-proposed

« back to all changes in this revision

Viewing changes to manila/share/drivers/netapp/dataontap/protocols/cifs_cmode.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant
  • Date: 2015-10-06 11:38:41 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20151006113841-y51cwvu8xijv31ba
Tags: 1:1.0.0~rc2-0ubuntu1
New upstream release candidate for OpenStack Liberty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import re
19
19
 
20
20
from oslo_log import log
21
 
from oslo_utils import importutils
22
21
 
23
22
from manila import exception
24
23
from manila.i18n import _, _LE
 
24
from manila.share.drivers.netapp.dataontap.client import api as netapp_api
25
25
from manila.share.drivers.netapp.dataontap.protocols import base
26
26
from manila.share.drivers.netapp import utils as na_utils
27
27
 
28
 
netapp_lib = importutils.try_import('netapp_lib')
29
 
if netapp_lib:
30
 
    from netapp_lib.api.zapi import errors as netapp_error
31
 
    from netapp_lib.api.zapi import zapi as netapp_api
32
28
 
33
29
LOG = log.getLogger(__name__)
34
30
 
62
58
        try:
63
59
            self._client.add_cifs_share_access(share_name, access['access_to'])
64
60
        except netapp_api.NaApiError as e:
65
 
            if e.code == netapp_error.EDUPLICATEENTRY:
 
61
            if e.code == netapp_api.EDUPLICATEENTRY:
66
62
                # Duplicate entry, so use specific exception.
67
63
                raise exception.ShareAccessExists(
68
64
                    access_type=access['access_type'], access=access)
76
72
        try:
77
73
            self._client.remove_cifs_share_access(share_name, user_name)
78
74
        except netapp_api.NaApiError as e:
79
 
            if e.code == netapp_error.EONTAPI_EINVAL:
 
75
            if e.code == netapp_api.EONTAPI_EINVAL:
80
76
                LOG.error(_LE("User %s does not exist."), user_name)
81
 
            elif e.code == netapp_error.EOBJECTNOTFOUND:
 
77
            elif e.code == netapp_api.EOBJECTNOTFOUND:
82
78
                LOG.error(_LE("Rule %s does not exist."), user_name)
83
79
            else:
84
80
                raise e