"Fossies" - the Fresh Open Source Software Archive

Member "tacker-2.0.0/tacker/cmd/status.py" (16 Oct 2019, 1535 Bytes) of package /linux/misc/openstack/tacker-2.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "status.py" see the Fossies "Dox" file reference documentation.

    1 # Copyright (c) 2018 NEC, Corp.
    2 #
    3 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    4 #    not use this file except in compliance with the License. You may obtain
    5 #    a copy of the License at
    6 #
    7 #         http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 #    Unless required by applicable law or agreed to in writing, software
   10 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   11 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   12 #    License for the specific language governing permissions and limitations
   13 #    under the License.
   14 
   15 import sys
   16 
   17 from oslo_config import cfg
   18 from oslo_upgradecheck import upgradecheck
   19 
   20 from tacker._i18n import _
   21 
   22 CONF = cfg.CONF
   23 
   24 
   25 class Checks(upgradecheck.UpgradeCommands):
   26 
   27     """Contains upgrade checks
   28 
   29     Various upgrade checks should be added as separate methods in this class
   30     and added to _upgrade_checks tuple.
   31     """
   32 
   33     def _sample_check(self):
   34         """This is sample check added to test the upgrade check framework
   35 
   36         It needs to be removed after adding any real upgrade check
   37         """
   38         return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail')
   39 
   40     _upgrade_checks = (
   41         # Sample check added for now.
   42         # Whereas in future real checks must be added here in tuple
   43         (_('Sample Check'), _sample_check),
   44     )
   45 
   46 
   47 def main():
   48     return upgradecheck.main(
   49         CONF, project='tacker', upgrade_command=Checks())
   50 
   51 
   52 if __name__ == '__main__':
   53     sys.exit(main())