tis-wapt-generate-random-uuid-if-needed icon

tis-wapt-generate-random-uuid-if-needed

Silent install package for tis-wapt-generate-random-uuid-if-needed

0-8

  • package: tis-wapt-generate-random-uuid-if-needed
  • version: 0-8
  • categories: Configuration
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • licence: wapt_public
  • locale: all
  • target_os: all
  • architecture: x64,x86
  • signature_date:
  • size: 7.46 Ko
  • conflicts :

package           : tis-wapt-generate-random-uuid-if-needed
version           : 0-8
architecture      : x64,x86
section           : base
priority          : optional
name              : 
categories        : Configuration
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : The computer will generate a random uuid if needed. Based on the non-unique uuids list provided
depends           : 
conflicts         : tis-generate-new-uuid
maturity          : PROD
locale            : all
target_os         : all
min_wapt_version  : 2.4
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : L'ordinateur génère un uuid aléatoire si nécessaire. Sur la base de la liste des uuids non uniques fournie
description_pl    : W razie potrzeby komputer wygeneruje losowy identyfikator uuid. Na podstawie dostarczonej listy nieunikalnych uuidów
description_de    : Der Computer generiert bei Bedarf eine zufällige uuid. Basierend auf der Liste der nicht eindeutigen uuids
description_es    : El ordenador generará un uuid aleatorio si es necesario. Basándose en la lista de uuids no únicos proporcionada
description_pt    : O computador irá gerar um uuid aleatório, se necessário. Com base na lista de uuids não exclusivos fornecida
description_it    : Se necessario, il computer genera un uuid casuale. In base all'elenco di uuid non univoci fornito
description_nl    : De computer genereert indien nodig een willekeurige uuid. Gebaseerd op de lijst met niet-unieke uuids
description_ru    : При необходимости компьютер сгенерирует случайный uuid. На основе предоставленного списка неуникальных uuid
audit_schedule    : 
editor            : 
keywords          : 
licence           : wapt_public
homepage          : 
package_uuid      : fde9b5e1-08fc-4bc2-a966-ae12ee1e85de
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 8e6b03d57120ace9015db72d4f395dd84064a86292ae0f505ea946379af26d42
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : n28nXsm6ya83ZvJE/kIORLhJh1FQ2iZjumf6iu/cgJb3H+kqiWlP1wRFENSKYIMQQOBh1x9JNU0i+K25rBtG5elMmRcV9GFij3ZwhAhNh5vyxj704ye0cMOrt00T2g7dUX2lxUzUpzM9gy3d535rGJhyzlmwfrRKgjeGdj2RHSyZcTI/BTCVqQz6JOR6YUD6t+BC7Trj4LU4qi9MqrIBgDBPnSHRi+zViPOULbkC3LC/JbtPds6HkNfGmzAZJ/rPdItOlH2RdgN1Y0bk5rObo/BYr09ZfRDCQ8/h4Xb7upLVVSbWn23sjuZyDHY0x0UFgFqqMfqTzKRbKg+QBMgiDA==
signature_date    : 2024-04-29T12:00:06.986280
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
from setuphelpers import *

# case-insensitivity
non_unique_uuids = [
    "90218F6F-8B87-8442-8AAD-4A676F39B1F3",
    "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF",
    "00000000-0000-0000-0000-000000000000",
    "Not Settable",
]


def install():
    try:
        try:
            uuid_bios = dmi_info()["System_Information"]["UUID"]
        except:
            uuid_bios = dmi_info()["System_Information"][0]["UUID"]
    except:
        print('This computer probably needs "include_dmi_inventory=1" parameter.')
    print("UUID BIOS: " + uuid_bios)
    try:
        uuid_wapt = WAPT.host_uuid
    except Exception as e:
        restart_waptservice_if_possible()
        error(e)
    print("UUID WAPT: " + uuid_wapt)

    if any([True for u in non_unique_uuids if u.lower() == uuid_bios.lower()]):
        new_uuid_wapt = str(WAPT.generate_host_uuid())
        print("New UUID WAPT: " + new_uuid_wapt)
        try:
            WAPT.register_computer()
        except:
            pass
        restart_waptservice_if_possible()
    elif uuid_wapt.lower().startswith("rnd-") and not any([True for u in non_unique_uuids if u.lower() == uuid_bios.lower()]):
        print(
            'This machine has already generated a random uuid. Based on the non_unique_uuids list provided, it does not seem to be needed. You may want to deploy the "tis-wapt-reset-uuid" package.'
        )
    else:
        print("Based on the non_unique_uuids list provided. This computer does not need to generate a random uuid.")


def restart_waptservice_if_possible():
    if get_os_name() == "Windows":
        wapt_get_path = makepath(WAPT.wapt_base_dir, "wapt-get.exe")
        create_onetime_task("restart-waptservice", wapt_get_path, "restart-waptservice", 2)
        print("waptservice will restart in 2mins.")
    else:
        print("waptservice may need to be restarted.")

7b2e07b72179a5ce29f7f70285e155401351162e7672c2661ce44c4a79af2c96 : setup.py
8e6b03d57120ace9015db72d4f395dd84064a86292ae0f505ea946379af26d42 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
529f170c40e5ad77e37860a8a939a6038e95c1001fe14a5162aee12b3219e787 : luti.json
58634435e9f8ab0d882d4b5639dc885223117e1eafe3bdf7b4c9bdc69f8288ab : WAPT/control