Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 877269 Details for
Bug 1074524
hwcert-backend plan ignores --server on first run
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch fixing --server, adding validation
0004-1074524-hwcert-backend-plan-ignores-server-on-first-.patch (text/plain), 3.88 KB, created by
Greg Nichols
on 2014-03-21 13:10:14 UTC
(
hide
)
Description:
patch fixing --server, adding validation
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2014-03-21 13:10:14 UTC
Size:
3.88 KB
patch
obsolete
>From d370577b9bdd1cd9fbc25fe01cdf97b25de07a88 Mon Sep 17 00:00:00 2001 >From: Greg Nichols <gnichols@redhat.com> >Date: Fri, 21 Mar 2014 08:57:04 -0400 >Subject: [PATCH 4/5] 1074524 - hwcert-backend plan ignores --server on first > run > >--- > hwcert/harness.py | 32 ++++++++++++++++++++------------ > hwcert/localTestServer.py | 16 ++++++++++++++-- > 2 files changed, 34 insertions(+), 14 deletions(-) > >diff --git a/hwcert/harness.py b/hwcert/harness.py >index 9bca39b..7680a44 100644 >--- a/hwcert/harness.py >+++ b/hwcert/harness.py >@@ -391,11 +391,8 @@ class HardwareTestHarness(Controller): > print "" > > # determine test server >- if self.options.server: >- self.certification.setTestServer(self.options.server) >- else: >- if self.certification.getTestServer(): >- self.options.server = self.certification.getTestServer() >+ if not self.options.server and self.certification.getTestServer(): >+ self.options.server = self.certification.getTestServer() > > > # Set up our system logging stuff >@@ -1121,16 +1118,27 @@ class HardwareTestHarness(Controller): > print "Error: %s is not an integer." % value > if value and int(value) >= 0: > self.certification.setCertificationID(value) >- >+ > # set a local test server >- print "Please provide the local Hardware Certification Test Server:" >- value = self.certification.getTestServer() >- value = self.ui.promptEdit(" hostname:", value) >- if len(value) > 0: >- self.certification.setTestServer(value) >+ serverHostname = self.options.server >+ if not serverHostname: >+ serverHostname = self.certification.getTestServer() >+ while True: >+ print "Please provide the local Hardware Certification Test Server:" >+ serverHostname = self.ui.promptEdit(" hostname:", serverHostname) >+ if len(serverHostname) == 0: >+ break >+ # validate the hostname (but don't verify). >+ server = LocalTestServer(serverHostname) >+ if server.getHostname(): >+ if server.getHostname() != serverHostname: >+ print "Setting Test Server to %s" % server.getHostname() >+ self.certification.setTestServer(server.getHostname()) >+ break >+ # otherwise >+ print "Error: \"%s\" is not a valid host name." > > # copy over to certification.xml > certificationDocument = CertificationDocument() > certificationDocument.copy(self.certification) > certificationDocument.save(self.environment.getCertificationPath()) >- >diff --git a/hwcert/localTestServer.py b/hwcert/localTestServer.py >index c1b53e7..12ce195 100644 >--- a/hwcert/localTestServer.py >+++ b/hwcert/localTestServer.py >@@ -15,15 +15,23 @@ > # > # localTestServer.py: hwcert client interface to the hwcert local test server > >-import urllib2, re >+import urllib2, re, urlparse > > from hwcert.tags import Constants > > class LocalTestServer(): > def __init__(self, hostname): >- self.hostname = hostname >+ self.hostname = None > self.status = None > self.errors = list() >+ # pull the host out of a url, if that's what we got. >+ url = urlparse.urlparse(hostname) >+ if url.netloc: >+ self.hostname = url.netloc >+ else: >+ pattern = re.compile("[\w\.\-]+$") >+ if pattern.match(hostname): >+ self.hostname = hostname > > def getStatus(self): > if not self.status: >@@ -38,6 +46,10 @@ class LocalTestServer(): > > def verify(self): > self.errors = list() >+ if not self.hostname: >+ self.errors.append("Error: no hostname is set") >+ return False >+ > print "\nVerifying hwcert Server %s:" % self.hostname > result = True > try: >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1074524
: 877269