Node modify algorithm


Node type rules

Note


for each person.to.insert0
     ldap lookup person
     insert/update person record
done

<update node>
     update department
     update make
     update model
     update address space1
     update location
     update room
     update expiration date
     update comment
     update pointer preferences2

     <update node types>
          for each node.type.to.delete
               delete node.type
          done
          for each node.type.to.insert
               insert node.type
          done

     <update groups>
          for each group.to.insert
               insert group
          done
          for each group.to.delete
               delete group
          done

     <update oses>
          for each os.to.insert
               insert os
          done
          for each os.to.delete
               delete os
          done

     <update node tags (a.k.a. custom fields)>
          for each tag.to.delete
               delete tag
          done
          for each tag.to.insert
               insert tag
          done

     <update admins>3
          for each ateam.to.insert
               insert ateam
          done
          for each admin.person.to.insert
               insert admin.person
          done
          for each admin.person.to.delete
               delete admin.person
          done
          for each ateam.to.delete
               delete ateam
          done

     <update users>
          for each user.to.delete
               delete user
          done
          for each user.to.insert
               insert user
          done

     <update interfaces>
          for each interface.to.delete
               delete interface
          done
          for each interface.to.insert
               insert interface
               for each dhcp.option
                    insert dhcp option
               end
          done
          for each interface.to.update
               update use-dhcp? flag
               update roaming? flag
               update hw address

               for each old.dhcp.options
                    delete dhcp.option
               done
               for each new.dhcp.options
                    insert dhcp.option
               done
          done

     <update ip addresses>
          for each ip.to.delete
               delete ip
          done
          for each ip.to.insert
               reserve ip
               accept ip
          done
          for each ip.to.update
               update active? flag
          done

     <update names>
          for each name.to.delete
               delete name
          done
          for each name.to.insert
               reserve name
               accept name
          done

     perform integrity check

-----------------------------------
0. Persons to insert collected from both admins and users
1. For templates only
2. Currently always set 0
3. Order is crucial in this section