def _validate_options(self):
        manifest_file = self._get_file_from_args()
        if not manifest_file:
            raise InvalidCLIOptionError(_("You must specify a manifest file."))

        if not os.path.isfile(manifest_file):
            raise InvalidCLIOptionError(_("The specified manifest file does not exist."))
Exemplo n.º 2
0
    def _validate_options(self):
        cert_file = self._get_file_from_args()
        if not cert_file:
            raise InvalidCLIOptionError(
                _("You must specify a certificate file."))

        if not os.path.isfile(cert_file):
            raise InvalidCLIOptionError(
                _("The specified certificate file does not exist."))
Exemplo n.º 3
0
 def _validate_options(self):
     if self.options.archive:
         if self.options.destination and not os.path.exists(self.options.destination):
             raise InvalidCLIOptionError(_("The destination directory for the archive must already exist."))
     # no archive, check if we can safely copy to dest.
     else:
         if not self._dirs_on_same_device(self.assemble_path, self.options.destination):
             msg = _("To use the no-archive option, the destination directory '%s' "
                     "must exist on the same file system as the "
                     "data assembly directory '%s'.") % (self.options.destination, self.assemble_path)
             raise InvalidCLIOptionError(msg)
     # In case folks are using this in a script
     if self.options.placeholder_for_subscriptions_option:
         log.info("The rhsm-debug options '--subscriptions' and '--no-subscriptions' have no effect now.")
Exemplo n.º 4
0
 def _create_cert(self):
     cert_file = self._get_file_from_args()
     try:
         return certificate.create_from_file(cert_file)
     except certificate.CertificateException as ce:
         raise InvalidCLIOptionError(
             _("Unable to read certificate file '{certificate}': {exception}"
               ).format(certificate=cert_file, exception=ce))
Exemplo n.º 5
0
 def _create_cert(self):
     cert_file = self._get_file_from_args()
     try:
         return certificate.create_from_file(cert_file)
     except certificate.CertificateException as ce:
         raise InvalidCLIOptionError(
             _("Unable to read certificate file '%s': %s") %
             (cert_file, ce))
 def _validate_options(self):
     if self.options.destination and self.options.archive:
         if not os.path.exists(self.options.destination):
             raise InvalidCLIOptionError(
                 _("The destination directory for the archive must already exist."
                   ))