Ejemplo n.º 1
0
    def render(self, session, logger, city, **arguments):
        dbcity = get_location(session, city=city)

        name = dbcity.name
        country = dbcity.country.name
        fullname = dbcity.fullname

        plenary = PlenaryCity(dbcity, logger=logger)
        CommandDelLocation.render(self, session=session, name=city,
                                  type='city', **arguments)
        session.flush()

        key = plenary.get_remove_key()
        try:
            lock_queue.acquire(key)
            plenary.remove(locked=True)
            dsdb_runner = DSDBRunner(logger=logger)
            dsdb_runner.del_city(name, country, fullname)
            dsdb_runner.commit_or_rollback()
        except:
            plenary.restore_stash()
            raise
        finally:
            lock_queue.release(key)

        return
Ejemplo n.º 2
0
    def render(self, session, logger, campus, **arguments):
        dbcampus = get_location(session, campus=campus)
        name = dbcampus.name

        result = CommandDelLocation.render(self, session=session, name=name,
                                           type='campus', **arguments)
        session.flush()

        dsdb_runner = DSDBRunner(logger=logger)
        dsdb_runner.del_campus(name)
        dsdb_runner.commit_or_rollback()

        return result
Ejemplo n.º 3
0
    def render(self, session, logger, city, **arguments):
        dbcity = get_location(session, city=city)

        name = dbcity.name
        country = dbcity.country.name
        fullname = dbcity.fullname

        plenary = Plenary.get_plenary(dbcity, logger=logger)
        CommandDelLocation.render(self, session=session, name=city,
                                  type='city', **arguments)
        session.flush()

        with plenary.get_key():
            try:
                plenary.remove(locked=True)
                dsdb_runner = DSDBRunner(logger=logger)
                dsdb_runner.del_city(name, country, fullname)
                dsdb_runner.commit_or_rollback()
            except:
                plenary.restore_stash()
                raise

        return
Ejemplo n.º 4
0
    def render(self, session, logger, building, **arguments):

        dbbuilding = get_location(session, building=building)

        city = dbbuilding.city
        address = dbbuilding.address
        campus = dbbuilding.campus

        result = CommandDelLocation.render(self, session=session, name=building,
                                           type='building', **arguments)
        session.flush()

        dsdb_runner = DSDBRunner(logger=logger)

        if campus:
            dsdb_runner.del_campus_building(campus.name, building)
        dsdb_runner.del_building(building, city.name, address)
        dsdb_runner.commit_or_rollback()

        return result
Ejemplo n.º 5
0
    def render(self, session, logger, building, **arguments):

        dbbuilding = get_location(session, building=building)

        city = dbbuilding.city
        address = dbbuilding.address
        campus = dbbuilding.campus

        result = CommandDelLocation.render(self,
                                           session=session,
                                           name=building,
                                           type='building',
                                           **arguments)
        session.flush()

        dsdb_runner = DSDBRunner(logger=logger)

        if campus:
            dsdb_runner.del_campus_building(campus.name, building)
        dsdb_runner.del_building(building, city.name, address)
        dsdb_runner.commit_or_rollback()

        return result
Ejemplo n.º 6
0
 def render(self, session, organization, **arguments):
     return CommandDelLocation.render(self, session=session,
                                      name=organization, type='company',
                                      **arguments)
Ejemplo n.º 7
0
 def render(self, session, rack, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=rack,
                                      type='rack',
                                      **arguments)
Ejemplo n.º 8
0
 def render(self, session, continent, **arguments):
     return CommandDelLocation.render(self, session=session, name=continent,
                                      type='continent', **arguments)
Ejemplo n.º 9
0
 def render(self, session, hub, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=hub,
                                      type='hub',
                                      **arguments)
Ejemplo n.º 10
0
 def render(self, session, desk, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=desk,
                                      type='desk',
                                      **arguments)
Ejemplo n.º 11
0
 def render(self, session, continent, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=continent,
                                      type='continent',
                                      **arguments)
Ejemplo n.º 12
0
 def render(self, session, hub, **arguments):
     return CommandDelLocation.render(self, session=session, name=hub,
                                      type='hub', **arguments)
Ejemplo n.º 13
0
 def render(self, session, desk, **arguments):
     return CommandDelLocation.render(self, session=session, name=desk, type="desk", **arguments)
Ejemplo n.º 14
0
 def render(self, session, bunker, **arguments):
     return CommandDelLocation.render(self, session=session, name=bunker,
                                      type='bunker', **arguments)
Ejemplo n.º 15
0
 def render(self, session, rack, **arguments):
     return CommandDelLocation.render(self, session=session, name=rack,
                                      type='rack', **arguments)
Ejemplo n.º 16
0
 def render(self, session, room, **arguments):
     return CommandDelLocation.render(self, session=session, name=room,
                                      type='room', **arguments)
Ejemplo n.º 17
0
 def render(self, session, country, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=country,
                                      type='country',
                                      **arguments)
Ejemplo n.º 18
0
 def render(self, session, country, **arguments):
     return CommandDelLocation.render(self, session=session, name=country,
                                      type='country', **arguments)
Ejemplo n.º 19
0
 def render(self, session, organization, **arguments):
     return CommandDelLocation.render(self, session=session, name=organization,
             type='company', **arguments)