300-635 · Question #5
Refer to the exhibit. Which change allows the code to configure VLAN 10 in the Cisco UCS? `` 1 from ucsmsdk.ucshandle import UcsHandle 2 from ucsmsdk.mometa.fabric.FabricVlan import FabricVlan 3 4…
The correct answer is B. Line 13 should include `handle.commit()`. Option B is correct because ucsmsdk uses a transactional model: handle.add_mo() stages the managed object locally in a pending transaction buffer, but changes are never sent to the UCS Manager until handle.commit() is explicitly called - omitting it means VLAN 10 is queued but…
Question
1 from ucsmsdk.ucshandle import UcsHandle
2 from ucsmsdk.mometa.fabric.FabricVlan import FabricVlan
3
4 handle = UcsHandle("corpucsm.example.com", "admin", "MySecretPassword")
5 handle.login()
6
7 fabric_lan_dn = handle.query_dn("fabric/lan")
8 newvlan = FabricVlan(parent_mo_or_dn=fabric_lan_dn,
9 name="vlan10",
10 id="10")
11
12 handle.add_mo(newvlan)
13
14 handle.logout()
Options
- ALines 8 and 9 should have a line continuation \ at the end.
- BLine 13 should include
handle.commit(). - CLine 4 should include transport 443 option.
- DLine 3 should add an import for query_dn.
How the community answered
(66 responses)- A8% (5)
- B74% (49)
- C15% (10)
- D3% (2)
Explanation
Option B is correct because ucsmsdk uses a transactional model: handle.add_mo() stages the managed object locally in a pending transaction buffer, but changes are never sent to the UCS Manager until handle.commit() is explicitly called - omitting it means VLAN 10 is queued but never applied.
Why the distractors are wrong:
- A is wrong because line continuation
\is unnecessary - theFabricVlan(...)call is already inside parentheses, making the multi-line syntax valid Python without\. - C is wrong because port 443 is UCS Manager's default HTTPS port and the connection already works (login succeeds); the transport isn't the issue blocking VLAN creation.
- D is wrong because
query_dnis an instance method onUcsHandle, not a standalone importable function -handle.query_dn()is available as-is.
Memory tip: Think of ucsmsdk like a database transaction - add_mo() is INSERT into a staging buffer, and commit() is COMMIT to the actual database. No commit = no change.
Topics
Community Discussion
No community discussion yet for this question.