Beispiel #1
0
def main():
    profile = smolt.get_profile()
    grabber = urlgrabber.grabber.URLGrabber(user_agent=opts.user_agent, timeout=opts.timeout)
    #first find out the server desired protocol
    try:
        #fli is a file like item
        pub_uuid_fli = grabber.urlopen(urljoin(opts.smoonURL + "/", '/client/pub_uuid?uuid=%s' % profile.host.UUID, False))
    except urlgrabber.grabber.URLGrabError, e:
        error(_('Error contacting Server: %s') % e)
        return 1
Beispiel #2
0
def main():
    profile = smolt.get_profile()
    #first find out the server desired protocol
    try:
        #fli is a file like item
        req = Request('/client/pub_uuid?uuid=%s' % profile.host.UUID)
        pub_uuid_fli.open()
    except urllib2.URLError, e:
        error(_('Error contacting Server: %s') % e)
        return 1
Beispiel #3
0
def main():
    profile = smolt.get_profile()
    #first find out the server desired protocol
    try:
        #fli is a file like item
        req = Request('/client/pub_uuid?uuid=%s' % profile.host.UUID)
        pub_uuid_fli.open()
    except urllib2.URLError, e:
        error(_('Error contacting Server: %s') % e)
        return 1
Beispiel #4
0
def main():
    profile = smolt.get_profile()
    grabber = urlgrabber.grabber.URLGrabber(user_agent=opts.user_agent,
                                            timeout=opts.timeout)
    #first find out the server desired protocol
    try:
        #fli is a file like item
        pub_uuid_fli = grabber.urlopen(
            urljoin(opts.smoonURL + "/",
                    '/client/pub_uuid?uuid=%s' % profile.host.UUID, False))
    except urlgrabber.grabber.URLGrabError, e:
        error(_('Error contacting Server: %s') % e)
        return 1
smolt.hw_uuid_file = opts.uuidFile
if opts.httpproxy == None:
    proxies = None
else:
    proxies = {'http':opts.httpproxy}

if opts.checkin and os.path.exists('/var/lock/subsys/smolt'):
    # Smolt is set to run
    opts.autoSend = True
elif opts.checkin:
    # Tried to check in but checkins are disabled
    print _('Smolt set to checkin but checkins are disabled (hint: service smolt start)')
    sys.exit(6)

# read the profile
profile = smolt.get_profile()

if opts.new_pub:
    pub_uuid = profile.regenerate_pub_uuid(user_agent=opts.user_agent,
                              smoonURL=opts.smoonURL,
                              timeout=opts.timeout)
    print _('Success!  Your new public UUID is: %s' % pub_uuid)
    sys.exit(0)

if opts.scanOnly:
    scan(profile, opts.smoonURL)
    rating(profile, opts.smoonURL)
    sys.exit(0)

for line in profile.getProfile():
    try:
Beispiel #6
0
    GateFromConfig(opts.the_only_config_file)

smolt.DEBUG = opts.DEBUG
smolt.hw_uuid_file = opts.uuidFile
if opts.httpproxy == None:
    proxies = None
else:
    proxies = {'http': opts.httpproxy}

if opts.checkin:
    # Smolt is set to run
    opts.autoSend = True

# read the profile
try:
    profile = smolt.get_profile()
except smolt.UUIDError, e:
    sys.stderr.write(_('%s\n' % e))
    sys.exit(9)

if opts.new_pub:
    try:
        pub_uuid = profile.regenerate_pub_uuid(user_agent=opts.user_agent,
                                               smoonURL=opts.smoonURL,
                                               timeout=opts.timeout)
    except ServerError, e:
        error(_('Error contacting server: %s') % str(e))
        sys.exit(1)

    print _('Success!  Your new public UUID is: %s' % pub_uuid)
    sys.exit(0)