示例#1
0
文件: del_city.py 项目: ned21/aquilon
    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
示例#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
示例#3
0
文件: del_city.py 项目: piojo/aquilon
    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
示例#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
示例#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
示例#6
0
 def render(self, session, organization, **arguments):
     return CommandDelLocation.render(self, session=session,
                                      name=organization, type='company',
                                      **arguments)
示例#7
0
 def render(self, session, rack, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=rack,
                                      type='rack',
                                      **arguments)
示例#8
0
 def render(self, session, continent, **arguments):
     return CommandDelLocation.render(self, session=session, name=continent,
                                      type='continent', **arguments)
示例#9
0
文件: del_hub.py 项目: ned21/aquilon
 def render(self, session, hub, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=hub,
                                      type='hub',
                                      **arguments)
示例#10
0
文件: del_desk.py 项目: ned21/aquilon
 def render(self, session, desk, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=desk,
                                      type='desk',
                                      **arguments)
示例#11
0
 def render(self, session, continent, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=continent,
                                      type='continent',
                                      **arguments)
示例#12
0
文件: del_hub.py 项目: jrha/aquilon
 def render(self, session, hub, **arguments):
     return CommandDelLocation.render(self, session=session, name=hub,
                                      type='hub', **arguments)
示例#13
0
 def render(self, session, desk, **arguments):
     return CommandDelLocation.render(self, session=session, name=desk, type="desk", **arguments)
示例#14
0
 def render(self, session, bunker, **arguments):
     return CommandDelLocation.render(self, session=session, name=bunker,
                                      type='bunker', **arguments)
示例#15
0
文件: del_rack.py 项目: jrha/aquilon
 def render(self, session, rack, **arguments):
     return CommandDelLocation.render(self, session=session, name=rack,
                                      type='rack', **arguments)
示例#16
0
 def render(self, session, room, **arguments):
     return CommandDelLocation.render(self, session=session, name=room,
                                      type='room', **arguments)
示例#17
0
 def render(self, session, country, **arguments):
     return CommandDelLocation.render(self,
                                      session=session,
                                      name=country,
                                      type='country',
                                      **arguments)
示例#18
0
 def render(self, session, country, **arguments):
     return CommandDelLocation.render(self, session=session, name=country,
                                      type='country', **arguments)
示例#19
0
 def render(self, session, organization, **arguments):
     return CommandDelLocation.render(self, session=session, name=organization,
             type='company', **arguments)