Package backend :: Package satellite_tools :: Package disk_dumper :: Module iss_ui
[hide private]
[frames] | no frames]

Source Code for Module backend.satellite_tools.disk_dumper.iss_ui

  1  # 
  2  # Copyright (c) 2008--2016 Red Hat, Inc. 
  3  # 
  4  # This software is licensed to you under the GNU General Public License, 
  5  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
  6  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
  7  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
  8  # along with this software; if not, see 
  9  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
 10  # 
 11  # Red Hat trademarks are not licensed under GPLv2. No permission is 
 12  # granted to use or replicate Red Hat trademarks that are incorporated 
 13  # in this software or its documentation. 
 14  # 
 15   
 16  from optparse import OptionParser, Option 
 17  from spacewalk.common.rhnConfig import PRODUCT_NAME 
 18   
 19  # Not strictly necessary, but makes them easier to type 
 20  option_parser = OptionParser 
 21  option = Option 
 22   
 23  # pylint: disable=R0903 
 24   
 25   
26 -class UI:
27
28 - def __init__(self):
29 self.optiontable = [ 30 option("-d", "--dir", action="store", 31 help="This is the directory that the information that you want to sync gets dumped in."), 32 option("--hard-links", action="store_true", default=0, 33 help="Exported RPM and kickstart are hard linked to original files."), 34 option("--list-channels", action="store_true", default=0, 35 help="List all of the channels that can be exported."), 36 option("--list-steps", action="store_true", default=0, 37 help="List all of the steps that rhn-satellite-exporter takes while exporting data." 38 + " These can be used as values for --step"), 39 option("-c", "--channel", action="append", 40 help="Include this channel in the export."), 41 option("-a", "--all-channels", action="store_true", default=0, 42 help="Export all channels."), 43 option("--start-date", action="store", 44 help="The start date limit that the last modified dates are compared against. " 45 + "Should be in the format 'YYYYMMDDHH24MISS'."), 46 option("--end-date", action="store", 47 help="The end date limit that the last modified dates are compared against. " 48 + "Should be in the format 'YYYYMMDDHH24MISS'."), 49 option("--use-rhn-date", action="store_true", 50 help="Limit exported packages according to the date when they appeared at Red Hat Network."), 51 option("--use-sync-date", action="store_true", 52 help="Limit exported packages according to the date they where pulled into %s." % PRODUCT_NAME), 53 option("--whole-errata", action="store_true", 54 help="Always include package if it belongs to errata which is withing start/end-date range."), 55 option("--make-isos", action="store", 56 help="Create channel dump isos a directory called satellite-isos. Usage: --make-isos=cd or dvd"), 57 option("-p", "--print-configuration", action="store_true", default=0, 58 help="Print the configuration and exit."), 59 option("--print-report", action="store_true", default=0, 60 help="Print the report to the terminal when the export is complete."), 61 option("--step", action="store", 62 help="Export only up to this step."), 63 option("--no-rpms", action="store_true", 64 help="Do not export RPMs."), 65 option("--no-packages", action="store_true", 66 help="Do not export package metadata."), 67 option("--no-errata", action="store_true", 68 help="Do not export errata data."), 69 option("--no-kickstarts", action="store_true", 70 help="Do not export kickstart data."), 71 option("--debug-level", action="store", 72 help="Set the debug level to this value. Overrides the value in rhn.conf."), 73 option("-v", "--verbose", action="store_true", 74 help="Set debug level to 3. Overrides the value in rhn.conf.."), 75 option("--email", action="store_true", 76 help="Email a report of what was exported."), 77 option("--traceback-mail", action="store", 78 help="Alternative email address for --email."), 79 option("--all-orgs", action="store_true", 80 help="Export all orgs."), 81 option("-o", "--org", action="append", 82 help="Include the org with this id in the export."), 83 option("--list-orgs", action="store_true", 84 help="List all orgs that can be exported"), 85 ] 86 self.optionparser = option_parser(option_list=self.optiontable) 87 self.options, self.args = self.optionparser.parse_args() 88 if self.options.verbose and not self.options.debug_level: 89 self.options.debug_level = 3 90 91 for i in self.options.__dict__.keys(): 92 if i not in self.__dict__: 93 self.__dict__[i] = self.options.__dict__[i]
94 95 if __name__ == "__main__": 96 # pylint: disable=E1101 97 a = UI() 98 print(str(a.no_errata)) 99