<s> """<STR_LIT>""" <EOL> import click <EOL> import SoftLayer <EOL> from SoftLayer . CLI import environment <EOL> from SoftLayer . CLI import exceptions <EOL> from SoftLayer . CLI import helpers <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . option ( '<STR_LIT>' , '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> type = click . Path ( exists = True , readable = True , resolve_path = True ) ) <EOL> @ click . option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> multiple = True , <EOL> help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> default = None , <EOL> type = click . Choice ( [ '<STR_LIT:0>' , '<STR_LIT>' , '<STR_LIT:100>' , '<STR_LIT>' , '<STR_LIT>' ] ) ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> default = None , <EOL> type = click . Choice ( [ '<STR_LIT:0>' , '<STR_LIT>' , '<STR_LIT:100>' , '<STR_LIT>' , '<STR_LIT>' ] ) ) <EOL> @ environment . pass_env <EOL> def cli ( env , identifier , domain , userfile , tag , hostname , userdata , <EOL> public_speed , private_speed ) : <EOL> """<STR_LIT>""" <EOL> if userdata and userfile : <EOL> raise exceptions . ArgumentError ( <EOL> '<STR_LIT>' ) <EOL> data = { <EOL> '<STR_LIT>' : hostname , <EOL> '<STR_LIT>' : domain , <EOL> } <EOL> if userdata : <EOL> data [ '<STR_LIT>' ] = userdata <EOL> elif userfile : <EOL> with open ( userfile , '<STR_LIT:r>' ) as userfile_obj : <EOL> data [ '<STR_LIT>' ] = userfile_obj . read ( ) <EOL> if tag : <EOL> data [ '<STR_LIT>' ] = '<STR_LIT:U+002C>' . join ( tag ) <EOL> mgr = SoftLayer . HardwareManager ( env . client ) <EOL> hw_id = helpers . resolve_id ( mgr . resolve_ids , identifier , '<STR_LIT>' ) <EOL> if not mgr . edit ( hw_id , ** data ) : <EOL> raise exceptions . CLIAbort ( "<STR_LIT>" ) <EOL> if public_speed is not None : <EOL> mgr . change_port_speed ( hw_id , True , int ( public_speed ) ) <EOL> if private_speed is not None : <EOL> mgr . change_port_speed ( hw_id , False , int ( private_speed ) ) </s>
