cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
649
Views
0
Helpful
1
Replies

Updating a phone with Python

mike.wilcox
Level 1
Level 1

SOLVED via Google.

 

Hello,

 

I am using python and suds-jerko to update the line label on phones. My issue is figuring out the formatting of the line info in updatePhone. using this code: 

 

resp = client.service.updatePhone(name = 'SEPAC44F214C7EB', description = "MJW Test",
lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'},
label : "83774356"}) 

 

I get this error:

 

NameError                                 Traceback (most recent call last)
/var/folders/7c/lghfcp0n1x5_kzxyj55__5g00000gn/T/ipykernel_41974/1536426317.py in <module>
      1 resp = client.service.updatePhone(name = 'SEPAC44F214C7EB', description = "MJW Test", 
----> 2                                  lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'},      3                                            label : "83774356"})

NameError: name 'lineIdentifier' is not defined

Any input on how to format this correctly?

 

THanks,

 

Mike 

 

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

Check your curly braces.  The "label" is incorrectly folded into the "lines":

 

lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'}, label : "83774356"}

Should be

lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'} } <-need another bracket here,
label : "83774356"}

 

View solution in original post

1 Reply 1

npetrele
Cisco Employee
Cisco Employee

Check your curly braces.  The "label" is incorrectly folded into the "lines":

 

lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'}, label : "83774356"}

Should be

lines = { lineIdentifier : {pattern : '83774356', routePartitionName : 'AMR-L1-PT'} } <-need another bracket here,
label : "83774356"}