(CommandList children: [ (C {(set)} {(-e)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:script_root) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})] ) left_token: <Left_Backtick '`'> spids: [54 62] ) } spids: [53] ) ] spids: [53] ) (C {(source)} {($ VSub_Name '$script_root') (/env.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CELLS) op: Equal rhs: { (BracedVarSub token: <VSub_Name CELLS> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ <test>)}) spids: [74 80] ) } spids: [73] ) ] spids: [73] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:keyspace) op: Equal rhs: {(SQ <test_keyspace>)} spids: [82] ) ] spids: [82] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SHARDS) op: Equal rhs: { (BracedVarSub token: <VSub_Name SHARDS> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ <0>)}) spids: [88 94] ) } spids: [87] ) ] spids: [87] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TABLETS_PER_SHARD) op: Equal rhs: { (BracedVarSub token: <VSub_Name TABLETS_PER_SHARD> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(5)}) spids: [97 101] ) } spids: [96] ) ] spids: [96] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:port) op:Equal rhs:{(15002)} spids:[103])] spids: [103] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:grpc_port) op:Equal rhs:{(16002)} spids:[106])] spids: [106] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:UID_BASE) op: Equal rhs: { (BracedVarSub token: <VSub_Name UID_BASE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(100)}) spids: [110 114] ) } spids: [109] ) ] spids: [109] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:VTTABLET_TEMPLATE) op: Equal rhs: { (BracedVarSub token: <VSub_Name VTTABLET_TEMPLATE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(SQ <vttablet-pod-template.yaml>)} ) spids: [117 123] ) } spids: [116] ) ] spids: [116] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:RDONLY_COUNT) op: Equal rhs: { (BracedVarSub token: <VSub_Name RDONLY_COUNT> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(2)}) spids: [126 130] ) } spids: [125] ) ] spids: [125] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uid_base) op: Equal rhs: {($ VSub_Name '$UID_BASE')} spids: [133] ) ] spids: [133] ) (ForEach iter_name: shard iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$SHARDS')}) (C {(tr)} {(DQ (','))} {(DQ (' '))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [142 158] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:cell_index) op:Equal rhs:{(0)} spids:[164])] spids: [164] ) (ForEach iter_name: cell iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$CELLS')}) (C {(tr)} {(SQ <','>)} {(SQ <' '>)}) ] negated: False ) ] ) left_token: <Left_Backtick '`'> spids: [174 190] ) } ] do_arg_iter: False body: (DoGroup children: [ (C {(echo)} { (DQ ('Creating ') ($ VSub_Name '$keyspace') (.shard-) ($ VSub_Name '$shard') (' pods in cell ') ($ VSub_Name '$CELL') (...) ) } ) (ForEach iter_name: uid_index iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(seq)} {(0)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$TABLETS_PER_SHARD')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [220 225] ) } ) ] ) left_token: <Left_Backtick '`'> spids: [215 226] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uid) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$uid_base')}) right: (ArithWord w:{($ VSub_Name '$uid_index')}) ) right: (ArithWord w:{($ VSub_Name '$cell_index')}) ) spids: [233 243] ) } spids: [232] ) ] spids: [232] ) (C {(printf)} {(-v)} {(alias)} {(SQ <'%s-%010d'>)} {($ VSub_Name '$cell')} {($ VSub_Name '$uid')} ) (C {(printf)} {(-v)} {(tablet_subdir)} {(SQ <'vt_%010d'>)} {($ VSub_Name '$uid')} ) (C {(echo)} {(DQ ('Creating pod for tablet ') ($ VSub_Name '$alias') (...))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shard_label) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$shard')}) (C {(sed)} {(s) (SQ <'/[-]$/-xx/'>)}) (C {(sed)} {(s) (SQ <'/^-/xx-/'>)}) ] negated: False ) ] ) left_token: <Left_Backtick '`'> spids: [294 316] ) } spids: [293] ) ] spids: [293] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tablet_type) op: Equal rhs: {(replica)} spids: [320] ) ] spids: [320] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$uid_index')} {(-gt)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w: {($ VSub_Name '$TABLETS_PER_SHARD')} ) right: (ArithWord w: {($ VSub_Name '$RDONLY_COUNT')} ) ) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [332 339] ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tablet_type) op: Equal rhs: {(rdonly)} spids: [347] ) ] spids: [347] ) ] spids: [16777215 344] ) ] spids: [16777215 351] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sed_script) op: Equal rhs: {(DQ )} spids: [359] ) ] spids: [359] ) (ForEach iter_name: var iter_words: [ {(alias)} {(cell)} {(uid)} {(keyspace)} {(shard)} {(shard_label)} {(port)} {(grpc_port)} {(tablet_subdir)} {(tablet_type)} {(backup_flags)} ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sed_script) op: PlusEqual rhs: { (DQ ('s,{{') ($ VSub_Name '$var') ('}},') (BracedVarSub token: <VSub_Name var> prefix_op: VSub_Bang spids: [401 404] ) (',g;') ) } spids: [396] ) ] spids: [396] ) ] spids: [393 409] ) spids: [369 391] ) (Pipeline children: [ (C {(cat)} {($ VSub_Name '$VTTABLET_TEMPLATE')}) (C {(sed)} {(-e)} {(DQ ($ VSub_Name '$sed_script'))}) (C {($ VSub_Name '$KUBECTL')} {(create)} {(-f)} {(-)}) ] negated: False ) ] spids: [229 442] ) spids: [214 227] ) (C {(let)} {(Lit_VarLike 'cell_index=') (cell_index) (Lit_Other '+') (100000000)}) ] spids: [193 453] ) spids: [173 191] ) (C {(let)} {(Lit_VarLike 'uid_base=') (uid_base) (Lit_Other '+') (100)}) ] spids: [161 463] ) spids: [141 159] ) ] )