Skip to content

Conversation

@kjeldflarup
Copy link
Contributor

When exporting USBSerialPort the exporter exports the host as the hostname. This may however not always resolve.

setting LG_HOSTNAME to ex an IP address will override gethostname() in the exporter
This variable can be used with ex. USBSerialPort, USBGenericExport, USBSigrokExport
Tested with USBSerialPort only.

@jluebbe
Copy link
Member

jluebbe commented Mar 13, 2018

There is already the --name parameter to set the name used to register resources. I've added a commit on top which implements an --hostname parameter instead of an environment variable. So far I've only tested it without real hardware.

@codecov-io
Copy link

codecov-io commented Mar 13, 2018

Codecov Report

Merging #218 into master will decrease coverage by <.1%.
The diff coverage is 14.2%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #218     +/-   ##
========================================
- Coverage    54.7%   54.6%   -0.1%     
========================================
  Files          93      93             
  Lines        5257    5269     +12     
========================================
+ Hits         2879    2881      +2     
- Misses       2378    2388     +10
Impacted Files Coverage Δ
labgrid/remote/exporter.py 34.3% <14.2%> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff0fc3e...85ab762. Read the comment docs.

@kjeldflarup
Copy link
Contributor Author

Could I get a copy of Your commit?

@jluebbe
Copy link
Member

jluebbe commented Mar 14, 2018

@kjeldflarup It's in this PR branch. See 144e3b8

@kjeldflarup
Copy link
Contributor Author

I have testet this on my Raspberry Pi and found it working.

jluebbe and others added 2 commits March 19, 2018 11:41
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
For resources like USBSerialPort, USBGenericExport or USBSigrokExport,
the exporter needs to provide a host name to set the exported value of
the "host" key. If the system hostname is not resolvable via DNS, this
option can be used to override this default with another name (or an IP
address).

Signed-off-by: Kjeld Flarup <kfa@deif.com>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
@jluebbe jluebbe changed the title Use LG_HOSTNAME to override gethostname() Use --hostname to override export host name Mar 19, 2018
@jluebbe jluebbe merged commit 5edee07 into labgrid-project:master Mar 19, 2018
@jluebbe jluebbe changed the title Use --hostname to override export host name Use --hostname to override exporter host name Mar 19, 2018
@kjeldflarup kjeldflarup deleted the exporter_hostname branch April 9, 2018 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants