(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ETCD_VERSION)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name ETCD_VERSION>
                suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(3.1.10)})
                spids: [49 53]
              )
            }
          spids: [48]
        )
      ]
      spids: [48]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ETCD_HOST)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name ETCD_HOST>
                suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(127.0.0.1)})
                spids: [56 60]
              )
            }
          spids: [55]
        )
      ]
      spids: [55]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ETCD_PORT)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name ETCD_PORT>
                suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(2379)})
                spids: [63 67]
              )
            }
          spids: [62]
        )
      ]
      spids: [62]
    )
    (FuncDef
      name: 'kube::etcd::validate'
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(which)} {(etcd)}]
                  redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[91])]
                )
                (BraceGroup
                  children: [
                    (C 
                      {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') 
                        (usage)
                      } {(DQ ('etcd must be in your PATH'))}
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [96]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (SimpleCommand
                          words: [{(pgrep)} {(-x)} {(etcd)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [133]
                            )
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 2
                              arg_word: {(1)}
                              spids: [136]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C 
                      {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') 
                        (usage)
                      } 
                      {
                        (DQ ('etcd appears to already be running on this machine (') 
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(pgrep)} {(-xl)} {(etcd)})])
                            left_token: <Left_Backtick '`'>
                            spids: [153 159]
                          ) (') (or its a zombie and you need to kill its parent).')
                        )
                      }
                    )
                    (C 
                      {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') 
                        (usage)
                      } {(DQ ('retry after you resolve this etcd error.'))}
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [16777215 140]
                )
              ]
              spids: [16777215 182]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:version)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(etcd)} {(--version)})
                                  (C {(tail)} {(-n)} {(Lit_Other '+') (1)})
                                  (C {(head)} {(-n)} {(1)})
                                  (C {(cut)} {(-d)} {(DQ (' '))} {(-f)} {(3)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [191 226]
                      )
                    }
                  spids: [190]
                )
              ]
              spids: [190]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_gt
                              left: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C 
                                            {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) 
                                              (Lit_Other ':') (Lit_Other ':') (version)
                                            } {($ VSub_Name '$ETCD_VERSION')}
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [233 243]
                                  )
                                }
                              right: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C 
                                            {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) 
                                              (Lit_Other ':') (Lit_Other ':') (version)
                                            } {($ VSub_Name '$version')}
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [247 257]
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(export)} 
                      {(Lit_VarLike 'PATH=') ($ VSub_Name '$KUBE_ROOT') (/third_party/etcd) 
                        (Lit_Other ':') ($ VSub_Name '$PATH')
                      }
                    )
                    (C {(hash)} {(etcd)})
                    (C {(echo)} {($ VSub_Name '$PATH')})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:version)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(etcd)} {(--version)})
                                          (C {(head)} {(-n)} {(1)})
                                          (C {(cut)} {(-d)} {(DQ (' '))} {(-f)} {(3)})
                                        ]
                                        negated: False
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [285 311]
                              )
                            }
                          spids: [284]
                        )
                      ]
                      spids: [284]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_gt
                                      left: 
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [
                                                  (C 
                                                    {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) 
                                                      (Lit_Other ':') (Lit_Other ':') (version)
                                                    } {($ VSub_Name '$ETCD_VERSION')}
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [318 328]
                                          )
                                        }
                                      right: 
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [
                                                  (C 
                                                    {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) 
                                                      (Lit_Other ':') (Lit_Other ':') (version)
                                                    } {($ VSub_Name '$version')}
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [332 342]
                                          )
                                        }
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C 
                              {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') 
                                (Lit_Other ':') (usage)
                              } {(DQ ('etcd version ') (${ VSub_Name ETCD_VERSION) (' or greater required.'))}
                            )
                            (C 
                              {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') 
                                (Lit_Other ':') (info)
                              } {(DQ ("You can use 'hack/install-etcd.sh' to install a copy in third_party/."))}
                            )
                            (C {(exit)} {(1)})
                          ]
                          spids: [16777215 347]
                        )
                      ]
                      spids: [16777215 385]
                    )
                  ]
                  spids: [16777215 262]
                )
              ]
              spids: [16777215 388]
            )
          ]
          spids: [80]
        )
      spids: [70 79]
    )
    (FuncDef
      name: 'kube::etcd::version'
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(printf)} {(SQ <'%s\\n'>)} {(DQ (${ VSub_At '@'))})
                (C {(awk)} {(-F)} {(.)} {(SQ <'{ printf("%d%03d%03d\\n", $1, $2, $3) }'>)})
              ]
              negated: False
            )
          ]
          spids: [403]
        )
      spids: [393 402]
    )
    (FuncDef
      name: 'kube::etcd::start'
      body: 
        (BraceGroup
          children: [
            (C 
              {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) (Lit_Other ':') (Lit_Other ':') (validate)}
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ETCD_DIR)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name ETCD_DIR>
                        suffix_op: 
                          (StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: 
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (AndOr
                                          children: [
                                            (SimpleCommand
                                              words: [{(mktemp)} {(-d)}]
                                              redirects: [
                                                (Redir
                                                  op_id: Redir_Great
                                                  fd: 2
                                                  arg_word: {(/dev/null)}
                                                  spids: [473]
                                                )
                                              ]
                                            )
                                            (C {(mktemp)} {(-d)} {(-t)} {(test-etcd.XXXXXX)})
                                          ]
                                          op_id: Op_DPipe
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [468 485]
                                )
                              }
                          )
                        spids: [465 486]
                      )
                    }
                  spids: [464]
                )
              ]
              spids: [464]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_d
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name ARTIFACTS_DIR>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [496 499]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:ETCD_LOGFILE)
                          op: Equal
                          rhs: 
                            {
                              (DQ (${ VSub_Name ARTIFACTS_DIR) (/etcd.) 
                                (CommandSubPart
                                  command_list: (CommandList children:[(C {(uname)} {(-n)})])
                                  left_token: <Left_CommandSub '$('>
                                  spids: [514 518]
                                ) (.) 
                                (CommandSubPart
                                  command_list: (CommandList children:[(C {(id)} {(-un)})])
                                  left_token: <Left_CommandSub '$('>
                                  spids: [520 524]
                                ) (.log.DEBUG.) 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (C {(date)} 
                                          {(Lit_Other '+') (Lit_Other '%') (Y) (Lit_Other '%') (m) 
                                            (Lit_Other '%') (d-) (Lit_Other '%') (H) (Lit_Other '%') (M) (Lit_Other '%') (S)
                                          }
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [526 542]
                                ) (.) ($ VSub_Dollar '$$')
                              )
                            }
                          spids: [508]
                        )
                      ]
                      spids: [508]
                    )
                  ]
                  spids: [16777215 505]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:ETCD_LOGFILE)
                      op: Equal
                      rhs: {(/dev/null)}
                      spids: [551]
                    )
                  ]
                  spids: [551]
                )
              ]
              spids: [548 555]
            )
            (C {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') (info)} 
              {
                (DQ ('etcd --advertise-client-urls http://') (${ VSub_Name ETCD_HOST) (':') 
                  (${ VSub_Name ETCD_PORT) (' --data-dir ') (${ VSub_Name ETCD_DIR) (' --listen-client-urls http://') (${ VSub_Name ETCD_HOST) (':') 
                  (${ VSub_Name ETCD_PORT) (' --debug > ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (${ VSub_Name ETCD_LOGFILE) 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' 2>/dev/null')
                )
              }
            )
            (Sentence
              child: 
                (SimpleCommand
                  words: [
                    {(etcd)}
                    {(--advertise-client-urls)}
                    {(http) (Lit_Other ':') (//) (${ VSub_Name ETCD_HOST) (Lit_Other ':') 
                      (${ VSub_Name ETCD_PORT)
                    }
                    {(--data-dir)}
                    {(${ VSub_Name ETCD_DIR)}
                    {(--listen-client-urls)}
                    {(http) (Lit_Other ':') (//) (${ VSub_Name ETCD_HOST) (Lit_Other ':') 
                      (${ VSub_Name ETCD_PORT)
                    }
                    {(--debug)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 2
                      arg_word: {(DQ (${ VSub_Name ETCD_LOGFILE))}
                      spids: [633]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [641]
                    )
                  ]
                )
              terminator: <Op_Amp '&'>
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ETCD_PID)
                  op: Equal
                  rhs: {($ VSub_Bang '$!')}
                  spids: [647]
                )
              ]
              spids: [647]
            )
            (C {(echo)} {(DQ ('Waiting for etcd to come up.'))})
            (C 
              {(kube) (Lit_Other ':') (Lit_Other ':') (util) (Lit_Other ':') (Lit_Other ':') 
                (wait_for_url)
              } {(DQ ('http://') (${ VSub_Name ETCD_HOST) (':') (${ VSub_Name ETCD_PORT) (/v2/machines))} 
              {(DQ ('etcd: '))} {(0.25)} {(80)}
            )
            (C {(curl)} {(-fs)} {(-X)} {(PUT)} 
              {
                (DQ ('http://') (${ VSub_Name ETCD_HOST) (':') (${ VSub_Name ETCD_PORT) (/v2/keys/_test))
              }
            )
          ]
          spids: [443]
        )
      spids: [433 442]
    )
    (FuncDef
      name: 'kube::etcd::stop'
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(kill)}
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name ETCD_PID>
                          suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )})
                          spids: [727 730]
                        )
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [733]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[736])
                  ]
                )
                (C {(Lit_Other ':')})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(wait)}
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name ETCD_PID>
                          suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )})
                          spids: [747 750]
                        )
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [753]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[756])
                  ]
                )
                (C {(Lit_Other ':')})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [721]
        )
      spids: [711 720]
    )
    (FuncDef
      name: 'kube::etcd::clean_etcd_dir'
      body: 
        (BraceGroup
          children: [
            (C {(rm)} {(-rf)} 
              {
                (DQ 
                  (BracedVarSub
                    token: <VSub_Name ETCD_DIR>
                    suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )})
                    spids: [784 787]
                  )
                )
              }
            )
          ]
          spids: [776]
        )
      spids: [766 775]
    )
    (FuncDef
      name: 'kube::etcd::cleanup'
      body: 
        (BraceGroup
          children: [
            (C {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) (Lit_Other ':') (Lit_Other ':') (stop)})
            (C 
              {(kube) (Lit_Other ':') (Lit_Other ':') (etcd) (Lit_Other ':') (Lit_Other ':') 
                (clean_etcd_dir)
              }
            )
          ]
          spids: [803]
        )
      spids: [793 802]
    )
    (FuncDef
      name: 'kube::etcd::install'
      body: 
        (BraceGroup
          children: [
            (Subshell
              child: 
                (CommandList
                  children: [
                    (C {(cd)} {(DQ (${ VSub_Name KUBE_ROOT) (/third_party))})
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (CommandSubPart
                                            command_list: (CommandList children:[(C {(uname)})])
                                            left_token: <Left_CommandSub '$('>
                                            spids: [856 858]
                                          )
                                        }
                                      right: {(DQ (Darwin))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:download_file)
                                  op: Equal
                                  rhs: {(DQ (etcd-v) (${ VSub_Name ETCD_VERSION) (-darwin-amd64.zip))}
                                  spids: [872]
                                )
                              ]
                              spids: [872]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:url)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ ('https://github.com/coreos/etcd/releases/download/v') 
                                        (${ VSub_Name ETCD_VERSION) (/) (${ VSub_Name download_file)
                                      )
                                    }
                                  spids: [882]
                                )
                              ]
                              spids: [882]
                            )
                            (C 
                              {(kube) (Lit_Other ':') (Lit_Other ':') (util) (Lit_Other ':') 
                                (Lit_Other ':') (download_file)
                              } {(DQ (${ VSub_Name url))} {(DQ (${ VSub_Name download_file))}
                            )
                            (C {(unzip)} {(-o)} {(DQ (${ VSub_Name download_file))})
                            (C {(ln)} {(-fns)} 
                              {(DQ (etcd-v) (${ VSub_Name ETCD_VERSION) (-darwin-amd64))} {(etcd)}
                            )
                            (C {(rm)} {(DQ (${ VSub_Name download_file))})
                          ]
                          spids: [16777215 869]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:url)
                              op: Equal
                              rhs: 
                                {
                                  (DQ ('https://github.com/coreos/etcd/releases/download/v') 
                                    (${ VSub_Name ETCD_VERSION) (/etcd-v) (${ VSub_Name ETCD_VERSION) (-linux-amd64.tar.gz)
                                  )
                                }
                              spids: [954]
                            )
                          ]
                          spids: [954]
                        )
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:download_file)
                              op: Equal
                              rhs: {(DQ (etcd-v) (${ VSub_Name ETCD_VERSION) (-linux-amd64.tar.gz))}
                              spids: [968]
                            )
                          ]
                          spids: [968]
                        )
                        (C 
                          {(kube) (Lit_Other ':') (Lit_Other ':') (util) (Lit_Other ':') (Lit_Other ':') 
                            (download_file)
                          } {(DQ (${ VSub_Name url))} {(DQ (${ VSub_Name download_file))}
                        )
                        (C {(tar)} {(xzf)} {(DQ (${ VSub_Name download_file))})
                        (C {(ln)} {(-fns)} {(DQ (etcd-v) (${ VSub_Name ETCD_VERSION) (-linux-amd64))} 
                          {(etcd)}
                        )
                      ]
                      spids: [951 1025]
                    )
                    (C 
                      {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') 
                        (info)
                      } {(DQ ('etcd v') (${ VSub_Name ETCD_VERSION) (' installed. To use:'))}
                    )
                    (C 
                      {(kube) (Lit_Other ':') (Lit_Other ':') (log) (Lit_Other ':') (Lit_Other ':') 
                        (info)
                      } 
                      {
                        (DQ ('export PATH=') 
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(pwd)})])
                            left_token: <Left_CommandSub '$('>
                            spids: [1055 1057]
                          ) ('/etcd:') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{PATH}')
                        )
                      }
                    )
                  ]
                )
              spids: [839 1064]
            )
          ]
          spids: [836]
        )
      spids: [826 835]
    )
  ]
)