Skip to content

Commit b65f76d

Browse files
committed
Convert username lookup to more portable option
1 parent 4073419 commit b65f76d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

newrelic/admin/record_deploy.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
16-
import pwd
15+
import getpass
1716

1817
from newrelic.admin import command, usage
1918
from newrelic.common import agent_http, encoding_utils
@@ -79,7 +78,7 @@ def record_deploy(
7978
path = f"/v2/applications/{app_id}/deployments.json"
8079

8180
if user is None:
82-
user = pwd.getpwuid(os.getuid()).pw_gecos
81+
user = getpass.getuser()
8382

8483
deployment = {}
8584
deployment["revision"] = revision

tests/testing_support/db_settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
# limitations under the License.
1414

1515
import os
16-
import pwd
17-
18-
USER = pwd.getpwuid(os.getuid()).pw_name
1916

2017

2118
def postgresql_settings():

0 commit comments

Comments
 (0)