Skip to content

Commit

Permalink
#31: Remove even more debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdope committed Jul 18, 2024
1 parent f016b10 commit c68d079
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ static int pusb_device_connected(t_pusb_options *opts, UDisksClient *udisks)

log_error("Searching for \"%s\" in the hardware database...\n", opts->device_list[currentDevice].name);

log_debug("Found %d drives to check/iterate...\n", g_list_length(objects));
for (i = 0; i < g_list_length(objects); ++i)
{
object = UDISKS_OBJECT(g_list_nth(objects, i)->data);
if (udisks_object_peek_drive(object))
{
drive = udisks_object_get_drive(object);
retval = strcmp(udisks_drive_get_serial(drive), opts->device_list[currentDevice].serial) == 0;
log_debug("Looking for serial '%s', found '%s'...\n", opts->device_list[currentDevice].serial, udisks_drive_get_serial(drive));

if (strcmp(opts->device_list[currentDevice].vendor, "Generic") != 0)
{
Expand Down
13 changes: 1 addition & 12 deletions tools/pamusb-agent
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,15 @@ def userDeviceThread(user):
to_watch = []

all_devices = doc.findall("devices/device")
logger.info('Found %d devices available for configuration.' % len(all_devices))

user_devices = user.findall("device")
logger.info('Found %d devices configured for user.' % len(user_devices))
for device in user_devices:
devices_for_user.append(device.text)
logger.info('devices_for_users: %s' % devices_for_user)

logger.info('Got all device data and configured devices for user, now creating watch list...')
deviceOK = False
for device in all_devices:
logger.info('Iterating all devices to find data for user devices...')
if device.get('id') in devices_for_user:
logger.info('Found a valid device for user "%s", adding to watchlist.' % userName)
to_watch.append({"name": device.get('id'), "serial": device.findtext('serial')})
deviceOK = True
else:
logger.info('Device "%s" is not valid for user' % device.get('id'))

if not deviceOK or len(to_watch) == 0:
logger.error('Device(s) not found in configuration file.')
Expand Down Expand Up @@ -326,13 +317,11 @@ def userDeviceThread(user):
hpDevs = []
threads = []
for watch_this in to_watch:
logger.info('Creating hpDev for device "%s" with serial "%s"...' % (watch_this.get('name'), watch_this.get('serial')))
logger.info('Watching device "%s" for user "%s"' % (watch_this.get('name'), userName))

hpDev = HotPlugDevice(watch_this.get('serial'), watch_this.get('name'))
hpDev.addCallback(authChangeCallback)

logger.info('Watching device "%s" for user "%s"' % (watch_this.get('name'), userName))

thread = threading.Thread(target=hpDev.run)
thread.start()

Expand Down

0 comments on commit c68d079

Please sign in to comment.