21912954 pkgrepo traceback if temp directory can't be created
authorYiteng Zhang <yiteng.zhang@oracle.com>
Fri, 27 Jan 2017 11:28:52 -0800
changeset 3503 d4edb40a7499
parent 3502 9e02c6dce40d
child 3504 e7420a5064c3
21912954 pkgrepo traceback if temp directory can't be created
src/pkgrepo.py
src/pull.py
src/sign.py
src/util/publish/pkgmerge.py
src/util/publish/pkgsurf.py
--- a/src/pkgrepo.py	Thu Jan 26 13:26:28 2017 -0800
+++ b/src/pkgrepo.py	Fri Jan 27 11:28:52 2017 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 PKG_CLIENT_NAME = "pkgrepo"
@@ -2325,7 +2325,7 @@
                 except (MemoryError, EnvironmentError) as __e:
                         if isinstance(__e, EnvironmentError) and \
                             __e.errno != errno.ENOMEM:
-                                raise
+                                raise apx._convert_error(__e)
                         error("\n" + misc.out_of_memory())
                         __ret = EXIT_OOPS
         except SystemExit as __e:
--- a/src/pull.py	Thu Jan 26 13:26:28 2017 -0800
+++ b/src/pull.py	Fri Jan 27 11:28:52 2017 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 from __future__ import print_function
@@ -1767,7 +1767,9 @@
                 raise _e
         except EnvironmentError as _e:
                 if _e.errno != errno.ENOSPC and _e.errno != errno.EDQUOT:
-                        raise
+                        error(str(apx._convert_error(_e)))
+                        __ret = 1
+                        sys.exit(__ret)
 
                 txt = "\n"
                 if _e.errno == errno.EDQUOT:
--- a/src/sign.py	Thu Jan 26 13:26:28 2017 -0800
+++ b/src/sign.py	Fri Jan 27 11:28:52 2017 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 import getopt
@@ -398,6 +398,9 @@
                 __ret = EXIT_OOPS
         except SystemExit as _e:
                 raise _e
+        except EnvironmentError as _e:
+                error(str(api_errors._convert_error(_e)))
+                __ret = 1
         except:
                 traceback.print_exc()
                 error(misc.get_traceback_message())
--- a/src/util/publish/pkgmerge.py	Thu Jan 26 13:26:28 2017 -0800
+++ b/src/util/publish/pkgmerge.py	Fri Jan 27 11:28:52 2017 -0800
@@ -20,7 +20,7 @@
 # CDDL HEADER END
 
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 from __future__ import print_function
@@ -988,6 +988,9 @@
                 __ret = EXIT_OOPS
         except SystemExit as __e:
                 raise __e
+        except EnvironmentError as __e:
+                error(str(apx._convert_error(__e)))
+                __ret = EXIT_OOPS
         except Exception as __e:
                 traceback.print_exc()
                 error(misc.get_traceback_message(), exitcode=None)
--- a/src/util/publish/pkgsurf.py	Thu Jan 26 13:26:28 2017 -0800
+++ b/src/util/publish/pkgsurf.py	Fri Jan 27 11:28:52 2017 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -818,6 +818,10 @@
                 error(_e)
                 cleanup()
                 __ret = pkgdefs.EXIT_OOPS
+        except EnvironmentError as _e:
+                error(api_errors._convert_error(_e))
+                cleanup()
+                __ret = pkgdefs.EXIT_OOPS
         except SystemExit as _e:
                 cleanup()
                 raise _e