]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: OpSmException.error -> OpSmException.errno 33674/head
authorMichael Fritch <mfritch@suse.com>
Tue, 3 Mar 2020 15:22:57 +0000 (08:22 -0700)
committerMichael Fritch <mfritch@suse.com>
Thu, 5 Mar 2020 20:19:34 +0000 (13:19 -0700)
fixes mypy errors:

volumes/fs/async_cloner.py: note: In function "handle_clone_pending":
volumes/fs/async_cloner.py:71: error: "OpSmException" has no attribute "error"; maybe "errno"?

volumes/fs/async_cloner.py: note: In function "handle_clone_in_progress":
volumes/fs/async_cloner.py:139: error: "OpSmException" has no attribute "error"; maybe "errno"?

Fixes: https://tracker.ceph.com/issues/44393
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/volumes/fs/async_cloner.py

index 17ddc89df0a6259189f8d96b95c7835583723a9e..048e06dd0d08287826c12c707c3c676cea642250 100644 (file)
@@ -68,7 +68,7 @@ def handle_clone_pending(volume_client, volname, index, groupname, subvolname, s
     try:
         next_state = OpSm.get_next_state("clone", "pending", 0)
     except OpSmException as oe:
-        raise VolumeException(oe.error, oe.error_str)
+        raise VolumeException(oe.errno, oe.error_str)
     return (next_state, False)
 
 def sync_attrs(fs_handle, target_path, source_statx):
@@ -159,7 +159,7 @@ def handle_clone_in_progress(volume_client, volname, index, groupname, subvolnam
         # jump to failed state
         next_state = OpSm.get_next_state("clone", "in-progress", -1)
     except OpSmException as oe:
-        raise VolumeException(oe.error, oe.error_str)
+        raise VolumeException(oe.errno, oe.error_str)
     return (next_state, False)
 
 def handle_clone_failed(volume_client, volname, index, groupname, subvolname, should_cancel):