BIND 10 #264: [kean] bindctl should recognize if has a tty or not, and wrong error message

BIND 10 Development do-not-reply at isc.org
Mon Nov 18 03:56:57 UTC 2013


#264: [kean] bindctl should recognize if has a tty or not, and wrong error
message
-------------------------------------+-------------------------------------
            Reporter:  jreed         |                        Owner:
                Type:  defect        |  UnAssigned
            Priority:  medium        |                       Status:
           Component:  bind-ctl      |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-20131015
         Sub-Project:  Core          |                   Resolution:
Estimated Difficulty:  0.0           |                 CVSS Scoring:
         Total Hours:                |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by kean):

 * owner:  kean => UnAssigned
 * status:  accepted => reviewing


Comment:

 Very simple fix. This is the output received before the fix:
 {{{
 $ echo "help" | ./bindctl
 Error reading saved username and password from
 /home/kean/.bind10/default_user.csv: [Errno 2] No such file or directory:
 '/home/kean/.bind10/default_user.csv'

 No stored password file found.

 When the system is first set up you need to create at least one user
 account.
 For information on how to set up a BIND 10 system, please check see the
 BIND 10 Guide:

 http://bind10.isc.org/docs/bind10-guide.html#quick-start-auth-dns

 If a user account has been set up, please check the b10-cmdctl log for
 other
 information.

 Username: /usr/lib64/python3.3/getpass.py:83: GetPassWarning: Can not
 control echo on the terminal.
   passwd = fallback_getpass(prompt, stream)
 Warning: Password input may be echoed.
 Password: Traceback (most recent call last):
   File "/usr/lib64/python3.3/getpass.py", line 63, in unix_getpass
     old = termios.tcgetattr(fd)     # a copy to save
 termios.error: (25, 'Inappropriate ioctl for device')

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/home/kean/isc/B10/lib64/python3.3/site-
 packages/isc/util/traceback_handler.py", line 33, in traceback_handler
     return main()
   File "./bindctl", line 163, in main
     result = tool.run()
   File "/home/kean/isc/B10/lib64/python3.3/site-
 packages/bindctl/bindcmd.py", line 156, in run
     if not self.login_to_cmdctl():
   File "/home/kean/isc/B10/lib64/python3.3/site-
 packages/bindctl/bindcmd.py", line 282, in login_to_cmdctl
     passwd = getpass.getpass()
   File "/usr/lib64/python3.3/getpass.py", line 83, in unix_getpass
     passwd = fallback_getpass(prompt, stream)
   File "/usr/lib64/python3.3/getpass.py", line 118, in fallback_getpass
     return _raw_input(prompt, stream)
   File "/usr/lib64/python3.3/getpass.py", line 134, in _raw_input
     raise EOFError
 EOFError

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "./bindctl", line 167, in <module>
     isc.util.traceback_handler.traceback_handler(main)
   File "/home/kean/isc/B10/lib64/python3.3/site-
 packages/isc/util/traceback_handler.py", line 38, in traceback_handler
     logger.fatal(PYTHON_UNHANDLED_EXCEPTION, type(e).__name__, e, name)
 RuntimeError: attempt to access logging function before logging has been
 initialized
 }}}

 and after the fix this is what is produced:
 {{{
 $ echo "help" | ./bindctl
 Error reading saved username and password from
 /home/kean/.bind10/default_user.csv: [Errno 2] No such file or directory:
 '/home/kean/.bind10/default_user.csv'

 No stored password file found.

 When the system is first set up you need to create at least one user
 account.
 For information on how to set up a BIND 10 system, please check see the
 BIND 10 Guide:

 http://bind10.isc.org/docs/bind10-guide.html#quick-start-auth-dns

 If a user account has been set up, please check the b10-cmdctl log for
 other
 information.
 }}}

 and bindctl exits cleanly (other than that message).

 Proposed changelog entry:
   When bindctl is used as a pipe, no longer attempt to query the user name
   and password if no default user name and password file is present, or it
   contains no valid entries.

-- 
Ticket URL: <http://bind10.isc.org/ticket/264#comment:10>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list