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
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
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
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
def render(self, session, organization, **arguments): return CommandDelLocation.render(self, session=session, name=organization, type='company', **arguments)
def render(self, session, rack, **arguments): return CommandDelLocation.render(self, session=session, name=rack, type='rack', **arguments)
def render(self, session, continent, **arguments): return CommandDelLocation.render(self, session=session, name=continent, type='continent', **arguments)
def render(self, session, hub, **arguments): return CommandDelLocation.render(self, session=session, name=hub, type='hub', **arguments)
def render(self, session, desk, **arguments): return CommandDelLocation.render(self, session=session, name=desk, type='desk', **arguments)
def render(self, session, desk, **arguments): return CommandDelLocation.render(self, session=session, name=desk, type="desk", **arguments)
def render(self, session, bunker, **arguments): return CommandDelLocation.render(self, session=session, name=bunker, type='bunker', **arguments)
def render(self, session, room, **arguments): return CommandDelLocation.render(self, session=session, name=room, type='room', **arguments)
def render(self, session, country, **arguments): return CommandDelLocation.render(self, session=session, name=country, type='country', **arguments)