(CommandList
  children: [
    (C {(set)} {(-o)} {(errexit)})
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:KUBE_ROOT)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(dirname)} 
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name BASH_SOURCE>
                              bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                              spids: [147 152]
                            )
                          )
                        }
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [143 154]
              ) (/../..)
            }
          spids: [142]
        )
      ]
      spids: [142]
    )
    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/photon-controller/util.sh))})
    (FuncDef
      name: main
      body: 
        (BraceGroup
          children: [
            (C {(verify-cmd-in-path)} {(photon)})
            (C {(set-target)})
            (C {(create-tenant)})
            (C {(create-project)})
            (C {(create-vm-flavor)} {(DQ (${ VSub_Name PHOTON_MASTER_FLAVOR))} 
              {(DQ (${ VSub_Name SETUP_MASTER_FLAVOR_SPEC))}
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ (${ VSub_Name PHOTON_MASTER_FLAVOR))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(DQ (${ VSub_Name PHOTON_NODE_FLAVOR))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(create-vm-flavor)} {(DQ (${ VSub_Name PHOTON_NODE_FLAVOR))} 
                      {(DQ (${ VSub_Name SETUP_NODE_FLAVOR_SPEC))}
                    )
                  ]
                  spids: [16777215 228]
                )
              ]
              spids: [16777215 246]
            )
            (C {(create-disk-flavor)})
            (C {(create-image)})
          ]
          spids: [174]
        )
      spids: [170 173]
    )
    (FuncDef
      name: parse-cmd-line
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PHOTON_TARGET)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ )})
                        spids: [265 270]
                      )
                    }
                  spids: [264]
                )
              ]
              spids: [264]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PHOTON_VMDK)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 2>
                        suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ )})
                        spids: [274 279]
                      )
                    }
                  spids: [273]
                )
              ]
              spids: [273]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalOr
                              left: 
                                (BoolBinary
                                  op_id: BoolBinary_GlobEqual
                                  left: {(DQ (${ VSub_Name PHOTON_TARGET))}
                                  right: {(DQ )}
                                )
                              right: 
                                (BoolBinary
                                  op_id: BoolBinary_GlobEqual
                                  left: {(DQ (${ VSub_Name PHOTON_VMDK))}
                                  right: {(DQ )}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Usage: setup-prereq <photon target> <path-to-kube-vmdk>'))})
                    (C {(echo)} {(DQ ('Target should be a URL like https://192.0.2.1'))})
                    (C {(echo)} {(DQ )})
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'This will create the following, based on the configuration in config-common.sh'
                          )
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('    * A tenant named ') (${ VSub_Name PHOTON_TENANT))})
                    (C {(echo)} {(DQ ('    * A project named ') (${ VSub_Name PHOTON_PROJECT))})
                    (C {(echo)} {(DQ ('    * A VM flavor named ') (${ VSub_Name PHOTON_MASTER_FLAVOR))})
                    (C {(echo)} {(DQ ('    * A disk flavor named ') (${ VSub_Name PHOTON_DISK_FLAVOR))})
                    (C {(echo)} {(DQ ('It will also upload the Kube VMDK'))})
                    (C {(echo)} {(DQ )})
                    (C {(echo)} {(DQ ('It creates the tenant with a resource ticket (quota) that may'))})
                    (C {(echo)} {(DQ ('be inappropriate for your environment. For a production'))})
                    (C {(echo)} {(DQ ('environment, you should configure these to match your'))})
                    (C {(echo)} {(DQ (environment.))})
                    (C {(exit)} {(1)})
                  ]
                  spids: [16777215 314]
                )
              ]
              spids: [16777215 430]
            )
            (C {(echo)} {(DQ ('Photon Target: ') (${ VSub_Name PHOTON_TARGET))})
            (C {(echo)} {(DQ ('Photon VMDK: ') (${ VSub_Name PHOTON_VMDK))})
          ]
          spids: [261]
        )
      spids: [257 260]
    )
    (FuncDef
      name: set-target
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(${ VSub_Name PHOTON)} {(target)} {(set)} {(DQ (${ VSub_Name PHOTON_TARGET))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(/dev/null)}
                  spids: [477]
                )
                (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[481])
              ]
            )
          ]
          spids: [460]
        )
      spids: [456 459]
    )
    (FuncDef
      name: create-tenant
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[496])]
              spids: [494]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:output) op:Equal spids:[502])]
              spids: [500]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(tenant)} {(list)})
                    (SimpleCommand
                      words: [
                        {(grep)}
                        {(-q)}
                        {(DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_TENANT) (Lit_Other '$'))}
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [529]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [533]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [538]
                    )
                  ]
                  spids: [538]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Tenant ') (${ VSub_Name PHOTON_TENANT) (' already made, skipping'))}
                    )
                  ]
                  spids: [16777215 557]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Making tenant ') (${ VSub_Name PHOTON_TENANT))})
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[584])]
                  spids: [584]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(tenant)}
                                          {(create)}
                                          {(DQ (${ VSub_Name PHOTON_TENANT))}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [604]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [589 606]
                              )
                            }
                          spids: [588]
                        )
                      ]
                      spids: [588]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} 
                          {
                            (DQ ('ERROR: Could not create tenant ') 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar '\\"'>
                              ) (${ VSub_Name PHOTON_TENANT) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (', exiting')
                            )
                          }
                        )
                        (C {(echo)} {(DQ ('Output from tenant creation:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [610]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              spids: [571 650]
            )
            (SimpleCommand
              words: [{(${ VSub_Name PHOTON)} {(tenant)} {(set)} {(DQ (${ VSub_Name PHOTON_TENANT))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(/dev/null)}
                  spids: [667]
                )
                (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[671])
              ]
            )
          ]
          spids: [491]
        )
      spids: [487 490]
    )
    (FuncDef
      name: create-project
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[686])]
              spids: [684]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:output) op:Equal spids:[692])]
              spids: [690]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(project)} {(list)})
                    (SimpleCommand
                      words: [
                        {(grep)}
                        {(-q)}
                        {
                          (DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_PROJECT) (Lit_Other '\\') (t))
                        }
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [720]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [724]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [729]
                    )
                  ]
                  spids: [729]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Project ') (${ VSub_Name PHOTON_PROJECT) (' already made, skipping'))}
                    )
                  ]
                  spids: [16777215 748]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Making project ') (${ VSub_Name PHOTON_PROJECT))})
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[775])]
                  spids: [775]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(resource-ticket)}
                                          {(create)}
                                          {(--tenant)}
                                          {(DQ (${ VSub_Name PHOTON_TENANT))}
                                          {(--name)}
                                          {(DQ (${ VSub_Name PHOTON_TENANT) (-resources))}
                                          {(--limits)}
                                          {(DQ (${ VSub_Name SETUP_TICKET_SPEC))}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [814]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [780 816]
                              )
                            }
                          spids: [779]
                        )
                      ]
                      spids: [779]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} {(DQ ('ERROR: Could not create resource ticket, exiting'))})
                        (C {(echo)} {(DQ ('Output from resource ticket creation:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [820]
                    )
                  ]
                  op_id: Op_DPipe
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[855])]
                  spids: [855]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(project)}
                                          {(create)}
                                          {(--tenant)}
                                          {(DQ (${ VSub_Name PHOTON_TENANT))}
                                          {(--resource-ticket)}
                                          {(DQ (${ VSub_Name PHOTON_TENANT) (-resources))}
                                          {(--name)}
                                          {(DQ (${ VSub_Name PHOTON_PROJECT))}
                                          {(--limits)}
                                          {(DQ (${ VSub_Name SETUP_PROJECT_SPEC))}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [902]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [860 904]
                              )
                            }
                          spids: [859]
                        )
                      ]
                      spids: [859]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} 
                          {
                            (DQ ('ERROR: Could not create project ') 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar '\\"'>
                              ) (${ VSub_Name PHOTON_PROJECT) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (', exiting')
                            )
                          }
                        )
                        (C {(echo)} {(DQ ('Output from project creation:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [908]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              spids: [762 948]
            )
            (C {(${ VSub_Name PHOTON)} {(project)} {(set)} {(DQ (${ VSub_Name PHOTON_PROJECT))})
          ]
          spids: [681]
        )
      spids: [677 680]
    )
    (FuncDef
      name: create-vm-flavor
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:flavor_name)
                  op: Equal
                  rhs: {(${ VSub_Number 1)}
                  spids: [977]
                )
              ]
              spids: [975]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:flavor_spec)
                  op: Equal
                  rhs: {(${ VSub_Number 2)}
                  spids: [985]
                )
              ]
              spids: [983]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[993])]
              spids: [991]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:output) op:Equal spids:[999])]
              spids: [997]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(flavor)} {(list)})
                    (SimpleCommand
                      words: [
                        {(grep)}
                        {(-q)}
                        {(DQ (Lit_Other '\\') (t) (${ VSub_Name flavor_name) (Lit_Other '\\') (t))}
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1027]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [1031]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [1036]
                    )
                  ]
                  spids: [1036]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(check-flavor-ready)} {(DQ (${ VSub_Name flavor_name))})
                    (C {(echo)} 
                      {(DQ ('Flavor ') (${ VSub_Name flavor_name) (' already made, skipping'))}
                    )
                  ]
                  spids: [16777215 1055]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Making VM flavor ') (${ VSub_Name flavor_name))})
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1091])]
                  spids: [1091]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(-n)}
                                          {(flavor)}
                                          {(create)}
                                          {(--name)}
                                          {(DQ (${ VSub_Name flavor_name))}
                                          {(--kind)}
                                          {(DQ (vm))}
                                          {(--cost)}
                                          {(DQ (${ VSub_Name flavor_spec))}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [1129]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [1096 1131]
                              )
                            }
                          spids: [1095]
                        )
                      ]
                      spids: [1095]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} 
                          {
                            (DQ ('ERROR: Could not create vm flavor ') 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar '\\"'>
                              ) (${ VSub_Name flavor_name) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (', exiting')
                            )
                          }
                        )
                        (C {(echo)} {(DQ ('Output from flavor creation:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [1135]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              spids: [1078 1175]
            )
          ]
          spids: [972]
        )
      spids: [968 971]
    )
    (FuncDef
      name: create-disk-flavor
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1189])]
              spids: [1187]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:output) op:Equal spids:[1195])]
              spids: [1193]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(flavor)} {(list)})
                    (SimpleCommand
                      words: [
                        {(grep)}
                        {(-q)}
                        {
                          (DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_DISK_FLAVOR) (Lit_Other '\\') (t))
                        }
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1223]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [1227]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [1232]
                    )
                  ]
                  spids: [1232]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(check-flavor-ready)} {(DQ (${ VSub_Name PHOTON_DISK_FLAVOR))})
                    (C {(echo)} 
                      {
                        (DQ ('Flavor ') (${ VSub_Name PHOTON_DISK_FLAVOR) (' already made, skipping'))
                      }
                    )
                  ]
                  spids: [16777215 1251]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Making disk flavor ') (${ VSub_Name PHOTON_DISK_FLAVOR))})
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1287])]
                  spids: [1287]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(-n)}
                                          {(flavor)}
                                          {(create)}
                                          {(--name)}
                                          {(DQ (${ VSub_Name PHOTON_DISK_FLAVOR))}
                                          {(--kind)}
                                          {(DQ (ephemeral-disk))}
                                          {(--cost)}
                                          {(DQ (${ VSub_Name SETUP_DISK_FLAVOR_SPEC))}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [1325]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [1292 1327]
                              )
                            }
                          spids: [1291]
                        )
                      ]
                      spids: [1291]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} 
                          {
                            (DQ ('ERROR: Could not create disk flavor ') 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar '\\"'>
                              ) (${ VSub_Name PHOTON_DISK_FLAVOR) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (', exiting')
                            )
                          }
                        )
                        (C {(echo)} {(DQ ('Output from flavor creation:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [1331]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              spids: [1274 1371]
            )
          ]
          spids: [1184]
        )
      spids: [1180 1183]
    )
    (FuncDef
      name: check-flavor-ready
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:flavor_name)
                  op: Equal
                  rhs: {(${ VSub_Number 1)}
                  spids: [1385]
                )
              ]
              spids: [1383]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1393])]
              spids: [1391]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:flavor_id) op:Equal spids:[1400])]
              spids: [1398]
            )
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:flavor_id)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (Pipeline
                                    children: [
                                      (C {(${ VSub_Name PHOTON)} {(flavor)} {(list)})
                                      (C {(grep)} 
                                        {
                                          (DQ (Lit_Other '\\') (t) (${ VSub_Name flavor_name) 
                                            (Lit_Other '\\') (t)
                                          )
                                        }
                                      )
                                      (C {(awk)} {(SQ <'{print $1}'>)})
                                    ]
                                    negated: False
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [1404 1434]
                          )
                        }
                      spids: [1403]
                    )
                  ]
                  spids: [1403]
                )
                (BraceGroup
                  children: [
                    (C {(echo)} 
                      {
                        (DQ ('ERROR: Found ') (${ VSub_Name flavor_name) (" but cannot find it's id"))
                      }
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [1438]
                )
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(flavor)} {(show)} {(DQ (${ VSub_Name flavor_id))})
                    (SimpleCommand
                      words: [
                        {(grep)}
                        {
                          (DQ (Lit_Other '\\') (tREADY) 
                            (EscapedLiteralPart
                              token: <Lit_EscapedChar '\\$'>
                            )
                          )
                        }
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1485]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [1489]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (BraceGroup
                  children: [
                    (C {(echo)} 
                      {
                        (DQ ('ERROR: Flavor ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) 
                          (${ VSub_Name flavor_name) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) 
                          (' already exists but is not READY. Please delete or fix it.')
                        )
                      }
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [1494]
                )
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [1380]
        )
      spids: [1376 1379]
    )
    (FuncDef
      name: create-image
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1529])]
              spids: [1527]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:num_images) op:Equal spids:[1535])]
              spids: [1533]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:output) op:Equal spids:[1540])]
              spids: [1538]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(image)} {(list)})
                    (C {(grep)} 
                      {(DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_IMAGE) (Lit_Other '\\') (t))}
                    )
                    (SimpleCommand
                      words: [{(grep)} {(-q)} {(ERROR)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1574]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [1578]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [1583]
                    )
                  ]
                  spids: [1583]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('Warning: You have at least one ') (${ VSub_Name PHOTON_IMAGE) 
                          (' image in the ERROR state. You may want to investigate.')
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('Images in the ERROR state will be ignored.'))})
                  ]
                  spids: [16777215 1602]
                )
              ]
              spids: [16777215 1623]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1627])]
              spids: [1627]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:num_images)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(${ VSub_Name PHOTON)} {(image)} {(list)})
                                  (C {(grep)} 
                                    {
                                      (DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_IMAGE) 
                                        (Lit_Other '\\') (t)
                                      )
                                    }
                                  )
                                  (C {(grep)} {(READY)})
                                  (C {(wc)} {(-l)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [1640 1674]
                      )
                    }
                  spids: [1639]
                )
              ]
              spids: [1639]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_gt
                              left: {(DQ (${ VSub_Name num_images))}
                              right: {(1)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('Warning: You have more than one good ') (${ VSub_Name PHOTON_IMAGE) 
                          (' image. You may want to remove duplicates.')
                        )
                      }
                    )
                  ]
                  spids: [16777215 1694]
                )
              ]
              spids: [16777215 1708]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PHOTON)} {(image)} {(list)})
                    (C {(grep)} 
                      {(DQ (Lit_Other '\\') (t) (${ VSub_Name PHOTON_IMAGE) (Lit_Other '\\') (t))}
                    )
                    (SimpleCommand
                      words: [{(grep)} {(-q)} {(READY)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1742]
                        )
                        (Redir
                          op_id: Redir_GreatAnd
                          fd: 2
                          arg_word: {(1)}
                          spids: [1746]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:rc)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [1751]
                    )
                  ]
                  spids: [1751]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolBinary op_id:BoolBinary_eq left:{(${ VSub_Name rc)} right:{(0)})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('Image ') (${ VSub_Name PHOTON_VMDK) (' already uploaded, skipping'))}
                    )
                  ]
                  spids: [16777215 1770]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('Uploading image ') (${ VSub_Name PHOTON_VMDK))})
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1797])]
                  spids: [1797]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:output)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (SimpleCommand
                                        words: [
                                          {(${ VSub_Name PHOTON)}
                                          {(image)}
                                          {(create)}
                                          {(DQ (${ VSub_Name PHOTON_VMDK))}
                                          {(-n)}
                                          {(DQ (${ VSub_Name PHOTON_IMAGE))}
                                          {(-i)}
                                          {(EAGER)}
                                        ]
                                        redirects: [
                                          (Redir
                                            op_id: Redir_GreatAnd
                                            fd: 2
                                            arg_word: {(1)}
                                            spids: [1829]
                                          )
                                        ]
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [1802 1831]
                              )
                            }
                          spids: [1801]
                        )
                      ]
                      spids: [1801]
                    )
                    (BraceGroup
                      children: [
                        (C {(echo)} {(DQ ('ERROR: Could not upload image, exiting'))})
                        (C {(echo)} {(DQ ('Output from image create:'))})
                        (C {(echo)} {(DQ (${ VSub_Name output))})
                        (C {(exit)} {(1)})
                      ]
                      spids: [1835]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              spids: [1784 1869]
            )
          ]
          spids: [1524]
        )
      spids: [1520 1523]
    )
    (C {(set)} {(Lit_Other '+') (o)} {(pipefail)})
    (C {(parse-cmd-line)} {(DQ ($ VSub_At '$@'))})
    (C {(main)})
  ]
)