(CommandList
  children: [
    (C {(set)} {(-o)} {(errexit)})
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:report_dir)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Number 1>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(_artifacts)})
                  spids: [77 81]
                )
              )
            }
          spids: [75]
        )
      ]
      spids: [73]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:gcs_artifacts_dir)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Number 2>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                  spids: [88 91]
                )
              )
            }
          spids: [86]
        )
      ]
      spids: [84]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:logexporter_namespace)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Number 3>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(logexporter)})
                  spids: [98 102]
                )
              )
            }
          spids: [96]
        )
      ]
      spids: [94]
    )
    (C {(echo)} {(DQ ('Checking for custom logdump instances, if any'))})
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(type)} {(-t)} {(log_dump_custom_get_instances)})]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [128 134]
                          )
                        }
                      right: {(DQ (function))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_Readonly
              pairs: [
                (assign_pair
                  lhs: (LhsName name:use_custom_instance_list)
                  op: Equal
                  rhs: {(yes)}
                  spids: [150]
                )
              ]
              spids: [148]
            )
          ]
          spids: [16777215 145]
        )
      ]
      else_action: [
        (Assignment
          keyword: Assign_Readonly
          pairs: [
            (assign_pair
              lhs: (LhsName name:use_custom_instance_list)
              op: Equal
              rhs: {(SQ )}
              spids: [158]
            )
          ]
          spids: [156]
        )
      ]
      spids: [153 160]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:master_ssh_supported_providers)
          op: Equal
          rhs: {(DQ ('gce aws'))}
          spids: [165]
        )
      ]
      spids: [163]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:node_ssh_supported_providers)
          op: Equal
          rhs: {(DQ ('gce gke aws'))}
          spids: [172]
        )
      ]
      spids: [170]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:gcloud_supported_providers)
          op: Equal
          rhs: {(DQ ('gce gke'))}
          spids: [179]
        )
      ]
      spids: [177]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:master_logfiles)
          op: Equal
          rhs: 
            {
              (DQ 
                (
'kube-apiserver kube-apiserver-audit kube-scheduler rescheduler kube-controller-manager etcd etcd-events glbc cluster-autoscaler kube-addon-manager fluentd'
                )
              )
            }
          spids: [187]
        )
      ]
      spids: [185]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:node_logfiles)
          op: Equal
          rhs: {(DQ ('kube-proxy fluentd node-problem-detector'))}
          spids: [194]
        )
      ]
      spids: [192]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:node_systemd_services)
          op: Equal
          rhs: {(DQ (node-problem-detector))}
          spids: [201]
        )
      ]
      spids: [199]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:hollow_node_logfiles)
          op: Equal
          rhs: {(DQ ('kubelet-hollow-node-* kubeproxy-hollow-node-* npd-hollow-node-*'))}
          spids: [208]
        )
      ]
      spids: [206]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:aws_logfiles)
          op: Equal
          rhs: {(DQ (cloud-init-output))}
          spids: [215]
        )
      ]
      spids: [213]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:gce_logfiles)
          op: Equal
          rhs: {(DQ (startupscript))}
          spids: [222]
        )
      ]
      spids: [220]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [(assign_pair lhs:(LhsName name:kern_logfile) op:Equal rhs:{(DQ (kern))} spids:[229])]
      spids: [227]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:initd_logfiles)
          op: Equal
          rhs: {(DQ (docker))}
          spids: [236]
        )
      ]
      spids: [234]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:supervisord_logfiles)
          op: Equal
          rhs: 
            {
              (DQ 
                (
'kubelet supervisor/supervisord supervisor/kubelet-stdout supervisor/kubelet-stderr supervisor/docker-stdout supervisor/docker-stderr'
                )
              )
            }
          spids: [243]
        )
      ]
      spids: [241]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:systemd_services)
          op: Equal
          rhs: {(DQ ('kubelet docker'))}
          spids: [250]
        )
      ]
      spids: [248]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [(assign_pair lhs:(LhsName name:max_scp_processes) op:Equal rhs:{(25)} spids:[264])]
      spids: [262]
    )
    (FuncDef
      name: setup
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:KUBE_ROOT)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [281 289]
                      ) (/../..)
                    }
                  spids: [280]
                )
              ]
              spids: [280]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_z
                              child: {(DQ (${ VSub_Name use_custom_instance_list))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(Lit_Other ':')} 
                      {
                        (BracedVarSub
                          token: <VSub_Name KUBE_CONFIG_FILE>
                          suffix_op: 
                            (StringUnary
                              op_id: VTest_ColonEquals
                              arg_word: {(DQ (config-test.sh))}
                            )
                          spids: [313 319]
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('Sourcing kube-util.sh'))})
                    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-util.sh))})
                    (C {(echo)} {(DQ ('Detecting project'))})
                    (SimpleCommand
                      words: [{(detect-project)}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[348])]
                    )
                  ]
                  spids: [16777215 308]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                              right: {(DQ (gke))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
"Using 'use_custom_instance_list' with gke, skipping check for LOG_DUMP_SSH_KEY and LOG_DUMP_SSH_USER"
                          )
                        )
                      }
                    )
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:gke_zone)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (BracedVarSub
                                  token: <VSub_Name ZONE>
                                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                  spids: [393 396]
                                )
                              )
                            }
                          spids: [391]
                        )
                      ]
                      spids: [389]
                    )
                    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/gce/util.sh))})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:ZONE)
                          op: Equal
                          rhs: {(DQ (${ VSub_Name gke_zone))}
                          spids: [410]
                        )
                      ]
                      spids: [410]
                    )
                  ]
                  spids: [352 371]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_z
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name LOG_DUMP_SSH_KEY>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [425 428]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'LOG_DUMP_SSH_KEY not set, but required when using log_dump_custom_get_instances'
                          )
                        )
                      }
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [418 434]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_z
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name LOG_DUMP_SSH_USER>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [456 459]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'LOG_DUMP_SSH_USER not set, but required when using log_dump_custom_get_instances'
                          )
                        )
                      }
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [449 465]
                )
              ]
              spids: [16777215 480]
            )
          ]
          spids: [277]
        )
      spids: [271 276]
    )
    (FuncDef
      name: log-dump-ssh
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_EqualTilde
                              left: {(DQ (${ VSub_Name gcloud_supported_providers))}
                              right: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(ssh-to-node)} {(DQ ($ VSub_At '$@'))})
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 515]
                )
              ]
              spids: [16777215 528]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:host)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [534]
                )
              ]
              spids: [532]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:cmd)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [542]
                )
              ]
              spids: [540]
            )
            (C {(ssh)} {(-oLogLevel) (Lit_Other '=') (quiet)} {(-oConnectTimeout) (Lit_Other '=') (30)} 
              {(-oStrictHostKeyChecking) (Lit_Other '=') (no)} {(-i)} {(DQ (${ VSub_Name LOG_DUMP_SSH_KEY))} 
              {(DQ (${ VSub_Name LOG_DUMP_SSH_USER) ('@') (${ VSub_Name host))} {(DQ (${ VSub_Name cmd))}
            )
          ]
          spids: [491]
        )
      spids: [485 490]
    )
    (FuncDef
      name: copy-logs-from-node
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:node)
                  op: Equal
                  rhs: {(DQ (${ VSub_Number 1))}
                  spids: [612]
                )
              ]
              spids: [608]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dir)
                  op: Equal
                  rhs: {(DQ (${ VSub_Number 2))}
                  spids: [624]
                )
              ]
              spids: [620]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:files)
                  op: Equal
                  rhs: {(ArrayLiteralPart words:[{(${ VSub_Number 3)}])}
                  spids: [634]
                )
              ]
              spids: [632]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:files)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (DQ 
                              (BracedVarSub
                                token: <VSub_Name files>
                                bracket_op: (WholeArray op_id:Lit_At)
                                suffix_op: 
                                  (PatSub
                                    pat: {}
                                    replace: {('.log*')}
                                    do_all: False
                                    do_prefix: False
                                    do_suffix: True
                                  )
                                spids: [660 669]
                              )
                            )
                          }
                        ]
                      )
                    }
                  spids: [656]
                )
              ]
              spids: [656]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:files)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (DQ 
                              (BracedVarSub
                                token: <VSub_Name files>
                                bracket_op: (WholeArray op_id:Lit_At)
                                suffix_op: 
                                  (PatSub
                                    pat: {}
                                    replace: 
                                      {(EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (var) 
                                        (EscapedLiteralPart
                                          token: <Lit_EscapedChar '\\/'>
                                        ) (log) (EscapedLiteralPart token:<Lit_EscapedChar '\\/'>)
                                      }
                                    do_all: False
                                    do_prefix: True
                                    do_suffix: False
                                  )
                                spids: [683 696]
                              )
                            )
                          }
                        ]
                      )
                    }
                  spids: [679]
                )
              ]
              spids: [679]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:scp_files)
                  op: Equal
                  rhs: 
                    {
                      (DQ ('{') 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(printf)} {(DQ ('%s,'))} 
                                  {
                                    (DQ 
                                      (BracedVarSub
                                        token: <VSub_Name files>
                                        bracket_op: (WholeArray op_id:Lit_At)
                                        spids: [721 726]
                                      )
                                    )
                                  }
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [713 728]
                        ) ('}')
                      )
                    }
                  spids: [710]
                )
              ]
              spids: [706]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_EqualTilde
                              left: {(DQ (${ VSub_Name gcloud_supported_providers))}
                              right: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(gcloud)}
                            {(compute)}
                            {(instances)}
                            {(get-serial-port-output)}
                            {(--project)}
                            {(DQ (${ VSub_Name PROJECT))}
                            {(--zone)}
                            {(DQ (${ VSub_Name ZONE))}
                            {(--port)}
                            {(1)}
                            {(DQ (${ VSub_Name node))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(DQ (${ VSub_Name dir) (/serial-1.log))}
                              spids: [796]
                            )
                          ]
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(gcloud)}
                            {(compute)}
                            {(scp)}
                            {(--recurse)}
                            {(--project)}
                            {(DQ (${ VSub_Name PROJECT))}
                            {(--zone)}
                            {(DQ (${ VSub_Name ZONE))}
                            {(DQ (${ VSub_Name node) (':') (${ VSub_Name scp_files))}
                            {(DQ (${ VSub_Name dir))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [850]
                            )
                          ]
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [16777215 755]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                              right: {(DQ (aws))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:ip)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [(C {(get_ssh_hostname)} {(DQ (${ VSub_Name node))})]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [884 892]
                              )
                            }
                          spids: [883]
                        )
                      ]
                      spids: [881]
                    )
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(scp)}
                            {(-oLogLevel) (Lit_Other '=') (quiet)}
                            {(-oConnectTimeout) (Lit_Other '=') (30)}
                            {(-oStrictHostKeyChecking) (Lit_Other '=') (no)}
                            {(-i)}
                            {(DQ (${ VSub_Name AWS_SSH_KEY))}
                            {
                              (DQ (${ VSub_Name SSH_USER) ('@') (${ VSub_Name ip) (':') 
                                (${ VSub_Name scp_files)
                              )
                            }
                            {(DQ (${ VSub_Name dir))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [937]
                            )
                          ]
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [859 878]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: {(DQ (${ VSub_Name use_custom_instance_list))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(scp)}
                            {(-oLogLevel) (Lit_Other '=') (quiet)}
                            {(-oConnectTimeout) (Lit_Other '=') (30)}
                            {(-oStrictHostKeyChecking) (Lit_Other '=') (no)}
                            {(-i)}
                            {(DQ (${ VSub_Name LOG_DUMP_SSH_KEY))}
                            {
                              (DQ (${ VSub_Name LOG_DUMP_SSH_USER) ('@') (${ VSub_Name node) (':') 
                                (${ VSub_Name scp_files)
                              )
                            }
                            {(DQ (${ VSub_Name dir))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1006]
                            )
                          ]
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [946 961]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {
                    (DQ ("Unknown cloud-provider '") (${ VSub_Name KUBERNETES_PROVIDER) 
                      ("' and use_custom_instance_list is unset too - skipping logdump for '") (${ VSub_Name node) ("'")
                    )
                  }
                )
              ]
              spids: [1015 1033]
            )
          ]
          spids: [605]
        )
      spids: [599 604]
    )
    (FuncDef
      name: save-logs
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:node_name)
                  op: Equal
                  rhs: {(DQ (${ VSub_Number 1))}
                  spids: [1066]
                )
              ]
              spids: [1062]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dir)
                  op: Equal
                  rhs: {(DQ (${ VSub_Number 2))}
                  spids: [1078]
                )
              ]
              spids: [1074]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:files)
                  op: Equal
                  rhs: {(DQ (${ VSub_Number 3))}
                  spids: [1088]
                )
              ]
              spids: [1086]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:opt_systemd_services)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Number 4>
                          suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ )})
                          spids: [1100 1105]
                        )
                      )
                    }
                  spids: [1098]
                )
              ]
              spids: [1096]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:on_master)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Number 5>
                          suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ (false))})
                          spids: [1113 1119]
                        )
                      )
                    }
                  spids: [1111]
                )
              ]
              spids: [1109]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: {(DQ (${ VSub_Name use_custom_instance_list))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolUnary
                                      op_id: BoolUnary_n
                                      child: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              token: <VSub_Name LOG_DUMP_SAVE_LOGS>
                                              suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                              spids: [1149 1152]
                                            )
                                          )
                                        }
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:files)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ (${ VSub_Name files) (' ') 
                                        (BracedVarSub
                                          token: <VSub_Name LOG_DUMP_SAVE_LOGS>
                                          suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                          spids: [1167 1170]
                                        )
                                      )
                                    }
                                  spids: [1161]
                                )
                              ]
                              spids: [1161]
                            )
                          ]
                          spids: [16777215 1158]
                        )
                      ]
                      spids: [16777215 1174]
                    )
                  ]
                  spids: [16777215 1139]
                )
              ]
              else_action: [
                (Case
                  to_match: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                  arms: [
                    (case_arm
                      pat_list: [{(gce)} {(gke)}]
                      action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:files)
                              op: Equal
                              rhs: {(DQ (${ VSub_Name files) (' ') (${ VSub_Name gce_logfiles))}
                              spids: [1197]
                            )
                          ]
                          spids: [1197]
                        )
                      ]
                      spids: [1191 1194 1209 16777215]
                    )
                    (case_arm
                      pat_list: [{(aws)}]
                      action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:files)
                              op: Equal
                              rhs: {(DQ (${ VSub_Name files) (' ') (${ VSub_Name aws_logfiles))}
                              spids: [1216]
                            )
                          ]
                          spids: [1216]
                        )
                      ]
                      spids: [1212 1213 1228 16777215]
                    )
                  ]
                  spids: [1180 1188 1231]
                )
              ]
              spids: [1177 1234]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:services)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {(${ VSub_Name systemd_services)}
                          {(${ VSub_Name opt_systemd_services)}
                          {
                            (BracedVarSub
                              token: <VSub_Name LOG_DUMP_SAVE_SERVICES>
                              suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{})
                              spids: [1252 1255]
                            )
                          }
                        ]
                      )
                    }
                  spids: [1241]
                )
              ]
              spids: [1237]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(log-dump-ssh)} {(DQ (${ VSub_Name node_name))} 
                          {(DQ ('command -v journalctl'))}
                        )
                      terminator: <Op_Amp '&'>
                    )
                    (Sentence
                      child: 
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1276]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: {(DQ (${ VSub_Name on_master))}
                                      right: {(DQ (true))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (AndOr
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(log-dump-ssh)}
                                    {(DQ (${ VSub_Name node_name))}
                                    {
                                      (DQ 
                                        (
'sudo journalctl --output=short-precise -u kube-master-installation.service'
                                        )
                                      )
                                    }
                                  ]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: 
                                        {(DQ (${ VSub_Name dir) (/kube-master-installation.log))}
                                      spids: [1318]
                                    )
                                  ]
                                )
                                (C {(true)})
                              ]
                              op_id: Op_DPipe
                            )
                            (AndOr
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(log-dump-ssh)}
                                    {(DQ (${ VSub_Name node_name))}
                                    {
                                      (DQ 
                                        (
'sudo journalctl --output=short-precise -u kube-master-configuration.service'
                                        )
                                      )
                                    }
                                  ]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: 
                                        {(DQ (${ VSub_Name dir) (/kube-master-configuration.log))}
                                      spids: [1344]
                                    )
                                  ]
                                )
                                (C {(true)})
                              ]
                              op_id: Op_DPipe
                            )
                          ]
                          spids: [16777215 1303]
                        )
                      ]
                      else_action: [
                        (AndOr
                          children: [
                            (SimpleCommand
                              words: [
                                {(log-dump-ssh)}
                                {(DQ (${ VSub_Name node_name))}
                                {
                                  (DQ 
                                    (
'sudo journalctl --output=short-precise -u kube-node-installation.service'
                                    )
                                  )
                                }
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: 16777215
                                  arg_word: {(DQ (${ VSub_Name dir) (/kube-node-installation.log))}
                                  spids: [1373]
                                )
                              ]
                            )
                            (C {(true)})
                          ]
                          op_id: Op_DPipe
                        )
                        (AndOr
                          children: [
                            (SimpleCommand
                              words: [
                                {(log-dump-ssh)}
                                {(DQ (${ VSub_Name node_name))}
                                {
                                  (DQ 
                                    (
'sudo journalctl --output=short-precise -u kube-node-configuration.service'
                                    )
                                  )
                                }
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: 16777215
                                  arg_word: {(DQ (${ VSub_Name dir) (/kube-node-configuration.log))}
                                  spids: [1399]
                                )
                              ]
                            )
                            (C {(true)})
                          ]
                          op_id: Op_DPipe
                        )
                      ]
                      spids: [1358 1413]
                    )
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(log-dump-ssh)}
                            {(DQ (${ VSub_Name node_name))}
                            {(DQ ('sudo journalctl --output=short-precise -k'))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(DQ (${ VSub_Name dir) (/kern.log))}
                              spids: [1428]
                            )
                          ]
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                    (ForEach
                      iter_name: svc
                      iter_words: [
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name services>
                              bracket_op: (WholeArray op_id:Lit_At)
                              spids: [1450 1455]
                            )
                          )
                        }
                      ]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (AndOr
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(log-dump-ssh)}
                                    {(DQ (${ VSub_Name node_name))}
                                    {
                                      (DQ ('sudo journalctl --output=cat -u ') (${ VSub_Name svc) 
                                        (.service)
                                      )
                                    }
                                  ]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(DQ (${ VSub_Name dir) (/) (${ VSub_Name svc) (.log))}
                                      spids: [1478]
                                    )
                                  ]
                                )
                                (C {(true)})
                              ]
                              op_id: Op_DPipe
                            )
                          ]
                          spids: [1459 1496]
                        )
                      spids: [1448 1457]
                    )
                  ]
                  spids: [16777215 1281]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:files)
                      op: Equal
                      rhs: 
                        {
                          (DQ (${ VSub_Name kern_logfile) (' ') (${ VSub_Name files) (' ') 
                            (${ VSub_Name initd_logfiles) (' ') (${ VSub_Name supervisord_logfiles)
                          )
                        }
                      spids: [1502]
                    )
                  ]
                  spids: [1502]
                )
              ]
              spids: [1499 1522]
            )
            (C {(echo)} {(DQ ('Changing logfiles to be world-readable for download'))})
            (AndOr
              children: [
                (C {(log-dump-ssh)} {(DQ (${ VSub_Name node_name))} {(DQ ('sudo chmod -R a+r /var/log'))})
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (C {(echo)} {(DQ ("Copying '") (${ VSub_Name files) ("' from ") (${ VSub_Name node_name))})
            (C {(copy-logs-from-node)} {(DQ (${ VSub_Name node_name))} {(DQ (${ VSub_Name dir))} 
              {(DQ (${ VSub_Name files))}
            )
          ]
          spids: [1059]
        )
      spids: [1053 1058]
    )
    (FuncDef
      name: dump_masters
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:master_names) op:Equal spids:[1599])]
              spids: [1597]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: {(DQ (${ VSub_Name use_custom_instance_list))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:master_names)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [(C {(log_dump_custom_get_instances)} {(master)})]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [1623 1627]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [1620]
                        )
                      ]
                      spids: [1620]
                    )
                  ]
                  spids: [16777215 1617]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: 
                                (BoolBinary
                                  op_id: BoolBinary_EqualTilde
                                  left: {(DQ (${ VSub_Name master_ssh_supported_providers))}
                                  right: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Master SSH not supported for ') (${ VSub_Name KUBERNETES_PROVIDER))}
                    )
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [1632 1655]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name KUBEMARK_MASTER_NAME>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [1678 1681]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:master_names)
                          op: Equal
                          rhs: {(ArrayLiteralPart words:[{(DQ (${ VSub_Name KUBEMARK_MASTER_NAME))}])}
                          spids: [1690]
                        )
                      ]
                      spids: [1690]
                    )
                  ]
                  spids: [1671 1687]
                )
              ]
              else_action: [
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (Pipeline
                              children: [(Subshell child:(C {(detect-master)}) spids:[1709 1711])]
                              negated: True
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(echo)} {(DQ ('Master not detected. Is the cluster up?'))})
                        (ControlFlow token:<ControlFlow_Return return>)
                      ]
                      spids: [16777215 1714]
                    )
                  ]
                  spids: [16777215 1727]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:master_names)
                      op: Equal
                      rhs: {(ArrayLiteralPart words:[{(DQ (${ VSub_Name MASTER_NAME))}])}
                      spids: [1730]
                    )
                  ]
                  spids: [1730]
                )
              ]
              spids: [1702 1742]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name master_names>
                                      prefix_op: VSub_Pound
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      spids: [1751 1757]
                                    )
                                  )
                                }
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('No masters found?'))})
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 1767]
                )
              ]
              spids: [16777215 1780]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:proc)
                  op: Equal
                  rhs: {(${ VSub_Name max_scp_processes)}
                  spids: [1784]
                )
              ]
              spids: [1784]
            )
            (ForEach
              iter_name: master_name
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name master_names>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [1797 1802]
                    )
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:master_dir)
                          op: Equal
                          rhs: {(DQ (${ VSub_Name report_dir) (/) (${ VSub_Name master_name))}
                          spids: [1809]
                        )
                      ]
                      spids: [1809]
                    )
                    (C {(mkdir)} {(-p)} {(DQ (${ VSub_Name master_dir))})
                    (Sentence
                      child: 
                        (C {(save-logs)} {(DQ (${ VSub_Name master_name))} 
                          {(DQ (${ VSub_Name master_dir))} {(DQ (${ VSub_Name master_logfiles))} {(DQ )} {(DQ (true))}
                        )
                      terminator: <Op_Amp '&'>
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:proc)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Minus
                                    left: (ArithVarRef name:proc)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [1876 1883]
                              )
                            }
                          spids: [1875]
                        )
                      ]
                      spids: [1875]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: (BoolBinary op_id:BoolBinary_eq left:{(proc)} right:{(0)})
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:proc)
                                  op: Equal
                                  rhs: {(${ VSub_Name max_scp_processes)}
                                  spids: [1902]
                                )
                              ]
                              spids: [1902]
                            )
                            (C {(wait)})
                          ]
                          spids: [16777215 1899]
                        )
                      ]
                      spids: [16777215 1911]
                    )
                  ]
                  spids: [1806 1914]
                )
              spids: [1795 1804]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalAnd
                              left: (BoolBinary op_id:BoolBinary_gt left:{(proc)} right:{(0)})
                              right: 
                                (BoolBinary
                                  op_id: BoolBinary_lt
                                  left: {(proc)}
                                  right: {(${ VSub_Name max_scp_processes)}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(wait)})]
                  spids: [16777215 1944]
                )
              ]
              spids: [16777215 1950]
            )
          ]
          spids: [1594]
        )
      spids: [1588 1593]
    )
    (FuncDef
      name: dump_nodes
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:node_names) op:Equal spids:[1966])]
              spids: [1964]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Number 1>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [1976 1979]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Dumping logs for nodes provided as args to dump_nodes() function'))}
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:node_names)
                          op: Equal
                          rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_At '$@'))}])}
                          spids: [1995]
                        )
                      ]
                      spids: [1995]
                    )
                  ]
                  spids: [16777215 1985]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: {(DQ (${ VSub_Name use_custom_instance_list))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'Dumping logs for nodes provided by log_dump_custom_get_instances() function'
                          )
                        )
                      }
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:node_names)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [(C {(log_dump_custom_get_instances)} {(node)})]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [2033 2037]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [2030]
                        )
                      ]
                      spids: [2030]
                    )
                  ]
                  spids: [2005 2020]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: 
                                (BoolBinary
                                  op_id: BoolBinary_EqualTilde
                                  left: {(DQ (${ VSub_Name node_ssh_supported_providers))}
                                  right: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Node SSH not supported for ') (${ VSub_Name KUBERNETES_PROVIDER))}
                    )
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [2042 2065]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Detecting nodes in the cluster'))})
                (Sentence child:(C {(detect-node-names)}) terminator:<Op_Amp '&'>)
                (SimpleCommand
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [2094]
                    )
                  ]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:node_names)
                      op: Equal
                      rhs: 
                        {
                          (ArrayLiteralPart
                            words: [
                              {
                                (DQ 
                                  (BracedVarSub
                                    token: <VSub_Name NODE_NAMES>
                                    bracket_op: (WholeArray op_id:Lit_At)
                                    spids: [2103 2108]
                                  )
                                )
                              }
                            ]
                          )
                        }
                      spids: [2099]
                    )
                  ]
                  spids: [2099]
                )
              ]
              spids: [2081 2114]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name node_names>
                                      prefix_op: VSub_Pound
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      spids: [2123 2129]
                                    )
                                  )
                                }
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('No nodes found!'))})
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 2139]
                )
              ]
              spids: [16777215 2152]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:node_logfiles_all)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name node_logfiles))}
                  spids: [2156]
                )
              ]
              spids: [2156]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name ENABLE_HOLLOW_NODE_LOGS>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [2169 2172]
                                    )
                                  )
                                }
                              right: {(DQ (true))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:node_logfiles_all)
                          op: Equal
                          rhs: 
                            {
                              (DQ (${ VSub_Name node_logfiles_all) (' ') 
                                (${ VSub_Name hollow_node_logfiles)
                              )
                            }
                          spids: [2187]
                        )
                      ]
                      spids: [2187]
                    )
                  ]
                  spids: [16777215 2184]
                )
              ]
              spids: [16777215 2199]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:nodes_selected_for_logs)
                  op: Equal
                  rhs: {(ArrayLiteralPart)}
                  spids: [2203]
                )
              ]
              spids: [2203]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name LOGDUMP_ONLY_N_RANDOM_NODES>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [2215 2218]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (ForEach
                      iter_name: index
                      iter_words: [
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (C {(shuf)} {(-i)} 
                                    {(0-) 
                                      (ArithSubPart
                                        anode: 
                                          (ArithBinary
                                            op_id: Arith_Minus
                                            left: 
                                              (ArithWord
                                                w: 
                                                  {
                                                    (BracedVarSub
                                                      token: <VSub_Name node_names>
                                                      prefix_op: VSub_Pound
                                                      bracket_op: (WholeArray op_id:Arith_Star)
                                                      spids: [2245 2251]
                                                    )
                                                  }
                                              )
                                            right: (ArithWord w:{(Lit_Digits 1)})
                                          )
                                        spids: [2243 2258]
                                      )
                                    } {(-n)} {(${ VSub_Name LOGDUMP_ONLY_N_RANDOM_NODES)}
                                  )
                                ]
                              )
                            left_token: <Left_Backtick '`'>
                            spids: [2237 2265]
                          )
                        }
                      ]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:nodes_selected_for_logs)
                                  op: PlusEqual
                                  rhs: 
                                    {
                                      (ArrayLiteralPart
                                        words: [
                                          {
                                            (DQ 
                                              (BracedVarSub
                                                token: <VSub_Name node_names>
                                                bracket_op: 
                                                  (ArrayIndex
                                                    expr: (ArithWord w:{($ VSub_Name '$index')})
                                                  )
                                                spids: [2274 2279]
                                              )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [2271]
                                )
                              ]
                              spids: [2271]
                            )
                          ]
                          spids: [2268 2284]
                        )
                      spids: [2236 16777215]
                    )
                  ]
                  spids: [16777215 2224]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:nodes_selected_for_logs)
                      op: Equal
                      rhs: 
                        {
                          (ArrayLiteralPart
                            words: [
                              {
                                (DQ 
                                  (BracedVarSub
                                    token: <VSub_Name node_names>
                                    bracket_op: (WholeArray op_id:Lit_At)
                                    spids: [2294 2299]
                                  )
                                )
                              }
                            ]
                          )
                        }
                      spids: [2290]
                    )
                  ]
                  spids: [2290]
                )
              ]
              spids: [2287 2305]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:proc)
                  op: Equal
                  rhs: {(${ VSub_Name max_scp_processes)}
                  spids: [2309]
                )
              ]
              spids: [2309]
            )
            (ForEach
              iter_name: node_name
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name nodes_selected_for_logs>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [2322 2327]
                    )
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:node_dir)
                          op: Equal
                          rhs: {(DQ (${ VSub_Name report_dir) (/) (${ VSub_Name node_name))}
                          spids: [2334]
                        )
                      ]
                      spids: [2334]
                    )
                    (C {(mkdir)} {(-p)} {(DQ (${ VSub_Name node_dir))})
                    (Sentence
                      child: 
                        (C {(save-logs)} {(DQ (${ VSub_Name node_name))} {(DQ (${ VSub_Name node_dir))} 
                          {(DQ (${ VSub_Name node_logfiles_all))} {(DQ (${ VSub_Name node_systemd_services))}
                        )
                      terminator: <Op_Amp '&'>
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:proc)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Minus
                                    left: (ArithVarRef name:proc)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [2408 2415]
                              )
                            }
                          spids: [2407]
                        )
                      ]
                      spids: [2407]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: (BoolBinary op_id:BoolBinary_eq left:{(proc)} right:{(0)})
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:proc)
                                  op: Equal
                                  rhs: {(${ VSub_Name max_scp_processes)}
                                  spids: [2434]
                                )
                              ]
                              spids: [2434]
                            )
                            (C {(wait)})
                          ]
                          spids: [16777215 2431]
                        )
                      ]
                      spids: [16777215 2443]
                    )
                  ]
                  spids: [2331 2446]
                )
              spids: [2320 2329]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalAnd
                              left: (BoolBinary op_id:BoolBinary_gt left:{(proc)} right:{(0)})
                              right: 
                                (BoolBinary
                                  op_id: BoolBinary_lt
                                  left: {(proc)}
                                  right: {(${ VSub_Name max_scp_processes)}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(wait)})]
                  spids: [16777215 2476]
                )
              ]
              spids: [16777215 2482]
            )
          ]
          spids: [1961]
        )
      spids: [1955 1960]
    )
    (FuncDef
      name: dump_nodes_with_logexporter
      body: 
        (BraceGroup
          children: [
            (C {(echo)} {(DQ ('Detecting nodes in the cluster'))})
            (Sentence child:(C {(detect-node-names)}) terminator:<Op_Amp '&'>)
            (SimpleCommand
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[2506])]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name NODE_NAMES>
                                      prefix_op: VSub_Pound
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      spids: [2517 2523]
                                    )
                                  )
                                }
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('No nodes found!'))})
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 2533]
                )
              ]
              spids: [16777215 2546]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:service_account_credentials)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (C {(cat)} {(${ VSub_Name GOOGLE_APPLICATION_CREDENTIALS)})
                                    (C {(base64)})
                                    (C {(tr)} {(-d)} {(SQ <'\\n'>)})
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [2560 2580]
                        )
                      )
                    }
                  spids: [2558]
                )
              ]
              spids: [2554]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:cloud_provider)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name KUBERNETES_PROVIDER))}
                  spids: [2588]
                )
              ]
              spids: [2584]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:enable_hollow_node_logs)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name ENABLE_HOLLOW_NODE_LOGS>
                          suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(false)})
                          spids: [2602 2606]
                        )
                      )
                    }
                  spids: [2600]
                )
              ]
              spids: [2596]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-r]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:logexport_sleep_seconds)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (ArithSubPart
                          anode: 
                            (ArithBinary
                              op_id: Arith_Plus
                              left: (ArithWord w:{(Lit_Digits 90)})
                              right: 
                                (ArithBinary
                                  op_id: Arith_Slash
                                  left: (ArithVarRef name:NUM_NODES)
                                  right: (ArithWord w:{(Lit_Digits 5)})
                                )
                            )
                          spids: [2616 2629]
                        )
                      )
                    }
                  spids: [2614]
                )
              ]
              spids: [2610]
            )
            (C {(sed)} {(-i) (SQ )} {(-e)} 
              {(DQ ('s@{{.LogexporterNamespace}}@') (${ VSub_Name logexporter_namespace) ('@g'))} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/log-dump/logexporter-daemonset.yaml))}
            )
            (C {(sed)} {(-i) (SQ )} {(-e)} 
              {
                (DQ ('s@{{.ServiceAccountCredentials}}@') (${ VSub_Name service_account_credentials) 
                  ('@g')
                )
              } {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/log-dump/logexporter-daemonset.yaml))}
            )
            (C {(sed)} {(-i) (SQ )} {(-e)} 
              {(DQ ('s@{{.CloudProvider}}@') (${ VSub_Name cloud_provider) ('@g'))} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/log-dump/logexporter-daemonset.yaml))}
            )
            (C {(sed)} {(-i) (SQ )} {(-e)} 
              {(DQ ('s@{{.GCSPath}}@') (${ VSub_Name gcs_artifacts_dir) ('@g'))} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/log-dump/logexporter-daemonset.yaml))}
            )
            (C {(sed)} {(-i) (SQ )} {(-e)} 
              {(DQ ('s@{{.EnableHollowNodeLogs}}@') (${ VSub_Name enable_hollow_node_logs) ('@g'))} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/log-dump/logexporter-daemonset.yaml))}
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:KUBECTL)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kubectl.sh))}
                  spids: [2763]
                )
              ]
              spids: [2763]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (Pipeline
                          children: [
                            (C {(DQ (${ VSub_Name KUBECTL))} {(create)} {(-f)} 
                              {
                                (DQ (${ VSub_Name KUBE_ROOT) 
                                  (/cluster/log-dump/logexporter-daemonset.yaml)
                                )
                              }
                            )
                          ]
                          negated: True
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'Failed to create logexporter daemonset.. falling back to logdump through SSH'
                          )
                        )
                      }
                    )
                    (AndOr
                      children: [
                        (C {(DQ (${ VSub_Name KUBECTL))} {(delete)} {(namespace)} 
                          {(DQ (${ VSub_Name logexporter_namespace))}
                        )
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                    (C {(dump_nodes)} 
                      {
                        (DQ 
                          (BracedVarSub
                            token: <VSub_Name NODE_NAMES>
                            bracket_op: (WholeArray op_id:Lit_At)
                            spids: [2828 2833]
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 2794]
                )
              ]
              spids: [16777215 2840]
            )
            (C {(sleep)} {(DQ (${ VSub_Name logexport_sleep_seconds))})
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:nodes_succeeded) op:Equal spids:[2864])]
              spids: [2862]
            )
            (ForEach
              iter_name: retry
              iter_words: [{(Lit_LBrace '{') (1..10) (Lit_RBrace '}')}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:nodes_succeeded)
                                      op: Equal
                                      rhs: 
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [
                                                  (C {(gsutil)} {(ls)} 
                                                    {(${ VSub_Name gcs_artifacts_dir) 
                                                      (/logexported-nodes-registry)
                                                    }
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [2884 2893]
                                          )
                                        }
                                      spids: [2883]
                                    )
                                  ]
                                  spids: [2883]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} {(DQ ('Successfully listed marker files for successful nodes'))})
                            (ControlFlow token:<ControlFlow_Break break>)
                          ]
                          spids: [16777215 2896]
                        )
                      ]
                      else_action: [
                        (C {(echo)} 
                          {
                            (DQ ('Attempt ') (${ VSub_Name retry) 
                              (' failed to list marker files for succeessful nodes')
                            )
                          }
                        )
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_GlobDEqual
                                          left: {(DQ (${ VSub_Name retry))}
                                          right: {(10)}
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (C {(echo)} 
                                  {
                                    (DQ 
                                      (
'Final attempt to list marker files failed.. falling back to logdump through SSH'
                                      )
                                    )
                                  }
                                )
                                (AndOr
                                  children: [
                                    (C {(DQ (${ VSub_Name KUBECTL))} {(delete)} {(namespace)} 
                                      {(DQ (${ VSub_Name logexporter_namespace))}
                                    )
                                    (C {(true)})
                                  ]
                                  op_id: Op_DPipe
                                )
                                (C {(dump_nodes)} 
                                  {
                                    (DQ 
                                      (BracedVarSub
                                        token: <VSub_Name NODE_NAMES>
                                        bracket_op: (WholeArray op_id:Lit_At)
                                        spids: [2974 2979]
                                      )
                                    )
                                  }
                                )
                                (ControlFlow
                                  token: <ControlFlow_Return return>
                                )
                              ]
                              spids: [16777215 2940]
                            )
                          ]
                          spids: [16777215 2986]
                        )
                        (C {(sleep)} {(2)})
                      ]
                      spids: [2909 2994]
                    )
                  ]
                  spids: [2878 2997]
                )
              spids: [2872 2876]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:failed_nodes)
                  op: Equal
                  rhs: {(ArrayLiteralPart)}
                  spids: [3013]
                )
              ]
              spids: [3013]
            )
            (ForEach
              iter_name: node
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name NODE_NAMES>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [3025 3030]
                    )
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (LogicalNot
                                      child: 
                                        (BoolBinary
                                          op_id: BoolBinary_EqualTilde
                                          left: {(DQ (${ VSub_Name nodes_succeeded))}
                                          right: {(DQ (${ VSub_Name node))}
                                        )
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} 
                              {
                                (DQ ("Logexporter didn't succeed on node ") (${ VSub_Name node) 
                                  ('. Queuing it for logdump through SSH.')
                                )
                              }
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:failed_nodes)
                                  op: PlusEqual
                                  rhs: {(ArrayLiteralPart words:[{(DQ (${ VSub_Name node))}])}
                                  spids: [3074]
                                )
                              ]
                              spids: [3074]
                            )
                          ]
                          spids: [16777215 3060]
                        )
                      ]
                      spids: [16777215 3084]
                    )
                  ]
                  spids: [3034 3087]
                )
              spids: [3023 3032]
            )
            (AndOr
              children: [
                (C {(DQ (${ VSub_Name KUBECTL))} {(delete)} {(namespace)} 
                  {(DQ (${ VSub_Name logexporter_namespace))}
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobNEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name failed_nodes>
                                      prefix_op: VSub_Pound
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      spids: [3121 3127]
                                    )
                                  )
                                }
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(-e)} 
                      {
                        (DQ ('Dumping logs through SSH for the following nodes:') (Lit_Other '\\') (n) 
                          (BracedVarSub
                            token: <VSub_Name failed_nodes>
                            bracket_op: (WholeArray op_id:Lit_At)
                            spids: [3148 3153]
                          )
                        )
                      }
                    )
                    (C {(dump_nodes)} 
                      {
                        (DQ 
                          (BracedVarSub
                            token: <VSub_Name failed_nodes>
                            bracket_op: (WholeArray op_id:Lit_At)
                            spids: [3160 3165]
                          )
                        )
                      }
                    )
                  ]
                  spids: [16777215 3137]
                )
              ]
              spids: [16777215 3169]
            )
          ]
          spids: [2493]
        )
      spids: [2487 2492]
    )
    (FuncDef
      name: main
      body: 
        (BraceGroup
          children: [
            (C {(setup)})
            (C {(echo)} {(DQ ("Dumping logs from master locally to '") (${ VSub_Name report_dir) ("'"))})
            (C {(dump_masters)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name DUMP_ONLY_MASTER_LOGS>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [3209 3212]
                                    )
                                  )
                                }
                              right: {(DQ (true))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Skipping dumping of node logs'))})
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 3224]
                )
              ]
              spids: [16777215 3237]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: {(DQ (${ VSub_Name gcs_artifacts_dir))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ("Dumping logs from nodes to GCS directly at '") 
                          (${ VSub_Name gcs_artifacts_dir) ("' using logexporter")
                        )
                      }
                    )
                    (C {(dump_nodes_with_logexporter)})
                  ]
                  spids: [16777215 3260]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {(DQ ("Dumping logs from nodes locally to '") (${ VSub_Name report_dir) ("'"))}
                )
                (C {(dump_nodes)})
              ]
              spids: [3277 3294]
            )
          ]
          spids: [3180]
        )
      spids: [3174 3179]
    )
    (C {(main)})
  ]
)