Bug 52668 - Kelvin API doesn't set properties profilepath and sambahome when creating users
Summary: Kelvin API doesn't set properties profilepath and sambahome when creating users
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
Version: UCS@school 4.4
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Daniel Tröder
QA Contact: Ole Schwiegert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-19 18:09 CET by Daniel Tröder
Modified: 2021-02-23 09:30 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support: Yes
Flags outvoted (downgraded) after PO Review:
Ticket number: 2021011521000445
Bug group (optional):
Customer ID: 57195
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2021-01-19 18:09:46 CET
New users are created with:
    profilepath: None
    sambahome: \\\<username>

The reason is that ucr.get("ucsschool/import/set/serverprofile/path") and ucr.get('ucsschool/import/set/sambahome') return "" in the Kelvin container instead of None.

Modify the code so that users are created with:
    profilepath: %LOGONSERVER%\%USERNAME%\windows-profiles\default
    sambahome: \\<OU-DC>\<username>
Comment 1 Daniel Tröder univentionstaff 2021-01-20 10:58:43 CET
Fixed in branch dtroeder/52668_profilepath:
97b7b5e79 Bug #52668: handle empty string instead of None from ucr.get()

At a later time we should investigate using the UCR code form the UCS 5.0 branch, instead of our own patches.
Comment 3 Ole Schwiegert univentionstaff 2021-02-16 09:22:25 CET
The profilepath is now set correctly, but the sambahome still has a problem. The UCRV "hostname" is not available, which results in the following:

Via Kelvin:
{
  "name": "test6",
  "school": "https://10.200.6.110/ucsschool/kelvin/v1/schools/DEMOSCHOOL",
  "firstname": "test",
  "lastname": "student",
  "birthday": "2021-02-16",
  "disabled": false,
  "record_uid": "test6",
  "roles": [
    "https://10.200.6.110/ucsschool/kelvin/v1/roles/student"
  ],
  "school_classes": {"DEMOSCHOOL": ["Democlass"]},
  "source_uid": "kelvin",
  "password": "12345678901234567890"
}

Result in udm:
  profilepath: %LOGONSERVER%\%USERNAME%\windows-profiles\default
  sambahome: \\None\test6

The None is the problem.
Comment 4 Ole Schwiegert univentionstaff 2021-02-17 07:38:49 CET
The "offensive" code snippet is this one:


elif ucr.is_true('ucsschool/singlemaster', False):
	samba_home_path = r'\\%s' % ucr.get('hostname')

The problem mentioned before thus only seem to occur on singleservers
Comment 5 Daniel Tröder univentionstaff 2021-02-17 08:54:52 CET
Thanks, I hadn't tested this on a singleserver system.
The problem was fixed by using the UCR variable "ldap/server/name" instead of "hostname".
The code has been merged to the feature/kelvin branch (b444f5193) and the Docker image version 1.3.0 has been rebuilt.
Comment 6 Ole Schwiegert univentionstaff 2021-02-17 09:43:19 CET
Tested on singleserver with the new image -> works like a charm now!
Comment 7 Daniel Tröder univentionstaff 2021-02-23 09:30:03 CET
A Kelvin API app with the changes in this bug has been published.