nerdexam
Juniper

JN0-224 · Question #153

Which two PyEZ object methods are included by default when using a Python context manager? (Choose two.)

The correct answer is A. lock () and unlock (> B. open() and close(). When using a Python context manager with Junos PyEZ, two key methods are automatically open() and close(): These methods are used to establish and terminate a connection to a Junos device. When you use a context manager (the with statement), open() is called when entering the…

PyEZ

Question

Which two PyEZ object methods are included by default when using a Python context manager? (Choose two.)

Options

  • Alock () and unlock (>
  • Bopen() and close()
  • C|load() and commit ()
  • Dpdiff() and diff()

How the community answered

(51 responses)
  • A
    88% (45)
  • C
    8% (4)
  • D
    4% (2)

Explanation

When using a Python context manager with Junos PyEZ, two key methods are automatically open() and close(): These methods are used to establish and terminate a connection to a Junos device. When you use a context manager (the with statement), open() is called when entering the block, and close() is called when exiting, ensuring the connection is properly managed. lock() and unlock(): These methods are used to lock the configuration database to prevent other users from making changes while you are working on it. When using a context manager, lock() is called at the start of the block, and unlock() is called at the end, ensuring safe configuration

Topics

#PyEZ context manager#open()#close()#lock()/unlock()

Community Discussion

No community discussion yet for this question.

Full JN0-224 Practice