<s> import nsenter <EOL> import subprocess <EOL> import sys <EOL> def host_mnt_exec ( cmd ) : <EOL> try : <EOL> with nsenter . ExitStack ( ) as stack : <EOL> stack . enter_context ( <EOL> nsenter . Namespace ( <EOL> '<STR_LIT:1>' , <EOL> '<STR_LIT>' , <EOL> proc = '<STR_LIT>' ) ) <EOL> process_ = subprocess . Popen ( cmd ) <EOL> except Exception as e : <EOL> print ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" , e ) <EOL> return process_ <EOL> if len ( sys . argv ) > <NUM_LIT:2> : <EOL> if str ( sys . argv [ <NUM_LIT:1> ] ) . startswith ( "<STR_LIT>" ) and ( <EOL> str ( sys . argv [ <NUM_LIT:2> ] ) . startswith ( "<STR_LIT:a>" ) or <EOL> str ( sys . argv [ <NUM_LIT:2> ] ) . startswith ( "<STR_LIT:d>" ) ) : <EOL> cmd = [ "<STR_LIT>" , "<STR_LIT>" ] + sys . argv [ <NUM_LIT:1> : ] <EOL> sys . exit ( host_mnt_exec ( cmd ) . returncode ) <EOL> else : <EOL> cmd = [ "<STR_LIT>" ] + sys . argv [ <NUM_LIT:1> : ] <EOL> else : <EOL> cmd = [ "<STR_LIT>" ] <EOL> if len ( sys . argv ) == <NUM_LIT:2> : <EOL> cmd = cmd + sys . argv [ <NUM_LIT:1> : ] <EOL> process_ = subprocess . Popen ( cmd ) <EOL> sys . exit ( process_ . returncode ) </s>
