diff --git a/.eslintrc.json b/.eslintrc.json
index be8f2c8f..1f97f031 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,18 +1,11 @@
{
"root": true,
- "ignorePatterns": [
- "projects/**/*"
- ],
+ "ignorePatterns": ["projects/**/*"],
"overrides": [
{
- "files": [
- "*.ts"
- ],
+ "files": ["*.ts"],
"parserOptions": {
- "project": [
- "tsconfig.json",
- "e2e/tsconfig.json"
- ],
+ "project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
@@ -45,12 +38,8 @@
}
},
{
- "files": [
- "*.html"
- ],
- "extends": [
- "plugin:@angular-eslint/template/recommended"
- ],
+ "files": ["*.html"],
+ "extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
"rules": {}
}
]
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 31887089..dc94fb7d 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
-title: ''
-labels: ['bug']
-assignees: ''
-
+title: ""
+labels: ["bug"]
+assignees: ""
---
**Describe the bug**
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
+
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
- - Browser [e.g. chrome, safari]
- - Version [e.g. 22]
+
+- OS: [e.g. iOS]
+- Browser [e.g. chrome, safari]
+- Version [e.g. 22]
**Smartphone (please complete the following information):**
- - Device: [e.g. iPhone6]
- - OS: [e.g. iOS8.1]
- - Browser [e.g. stock browser, safari]
- - Version [e.g. 22]
+
+- Device: [e.g. iPhone6]
+- OS: [e.g. iOS8.1]
+- Browser [e.g. stock browser, safari]
+- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index abd8476b..bf7a8e26 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
-title: ''
-labels: ['enhancement']
-assignees: ''
-
+title: ""
+labels: ["enhancement"]
+assignees: ""
---
**Is your feature request related to a problem? Please describe.**
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 960ece5e..84cb168d 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -1,22 +1,22 @@
API-Client:
-- projects/cobbler-api/*
-- projects/cobbler-api/**/*
+ - projects/cobbler-api/*
+ - projects/cobbler-api/**/*
Frontend:
-- projects/cobbler-frontend/*
-- projects/cobbler-frontend/**/*
+ - projects/cobbler-frontend/*
+ - projects/cobbler-frontend/**/*
TS-XMLRPC:
-- projects/typescript-xmlrpc/*
-- projects/typescript-xmlrpc/**/*
+ - projects/typescript-xmlrpc/*
+ - projects/typescript-xmlrpc/**/*
documentation:
-- docs-additional/*
-- docs-additional/**/*
+ - docs-additional/*
+ - docs-additional/**/*
tests:
-- '*.spec.ts'
+ - "*.spec.ts"
dependencies:
-- package.json
-- package-lock.json
+ - package.json
+ - package-lock.json
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index e2a3e938..c22001e8 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -13,12 +13,12 @@ name: "CodeQL"
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
# The branches below must be a subset of the branches above
- branches: [ main ]
+ branches: [main]
schedule:
- - cron: '34 17 * * 4'
+ - cron: "34 17 * * 4"
jobs:
analyze:
@@ -32,39 +32,39 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'javascript' ]
+ language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- - name: Checkout repository
- uses: actions/checkout@v4
+ - name: Checkout repository
+ uses: actions/checkout@v4
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v3
- # âšī¸ Command-line programs to run using the OS shell.
- # đ https://git.io/JvXDl
+ # âšī¸ Command-line programs to run using the OS shell.
+ # đ https://git.io/JvXDl
- # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
- # and modify them (or add more) to build your code if your project
- # uses a compiled language
+ # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
- #- run: |
- # make bootstrap
- # make release
+ #- run: |
+ # make bootstrap
+ # make release
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/container-build-push.yml b/.github/workflows/container-build-push.yml
index ee325494..24bcca86 100644
--- a/.github/workflows/container-build-push.yml
+++ b/.github/workflows/container-build-push.yml
@@ -4,7 +4,7 @@ name: Create and publish a Docker image
on:
push:
- branches: ['main']
+ branches: ["main"]
env:
REGISTRY: ghcr.io
diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml
index a1b2adbd..faeffd20 100644
--- a/.github/workflows/coverage-upload.yml
+++ b/.github/workflows/coverage-upload.yml
@@ -12,7 +12,7 @@ jobs:
steps:
# https://github.com/actions/github-script
# Based on: https://github.com/orgs/community/discussions/34652
- - name: 'Download artifact'
+ - name: "Download artifact"
uses: actions/github-script@v7
with:
script: |
@@ -52,24 +52,24 @@ jobs:
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-xmlrpc.zip`, Buffer.from(downloadXmlRpc.data));
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-api.zip`, Buffer.from(downloadApi.data));
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-frontend.zip`, Buffer.from(downloadFrontend.data));
- - name: 'Create folder structure'
+ - name: "Create folder structure"
run: |
mkdir -p coverage/typescript-xmlrpc
mkdir -p coverage/cobbler-api
mkdir -p coverage/cobbler-frontend
- - name: 'Unzip typescript-xmlrpc artifact'
+ - name: "Unzip typescript-xmlrpc artifact"
run: |
unzip coverage-report-xmlrpc.zip
mv lcov.info coverage/typescript-xmlrpc
- - name: 'Unzip cobbler-api artifact'
+ - name: "Unzip cobbler-api artifact"
run: |
unzip coverage-report-api.zip
mv lcov.info coverage/cobbler-api
- - name: 'Unzip cobbler-frontend artifact'
+ - name: "Unzip cobbler-frontend artifact"
run: |
unzip coverage-report-frontend.zip
mv lcov.info coverage/cobbler-frontend
- - name: 'Show filetree'
+ - name: "Show filetree"
run: |
sudo apt-get install -y tree
tree
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index aa069c46..73cdbe3d 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -2,9 +2,9 @@ name: Docs
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
- branches: [ main ]
+ branches: [main]
jobs:
build:
@@ -30,7 +30,7 @@ jobs:
name: documentation
path: documentation
deploy:
- name : Deploy đ
+ name: Deploy đ
needs: [build]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 924ae71f..862eeca8 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -9,7 +9,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- - uses: actions/labeler@v4
+ - uses: actions/labeler@v5
with:
sync-labels: true
repo-token: "${{ secrets.GITHUB_TOKEN }}"
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 0c68715c..d0431dc3 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -2,18 +2,39 @@ name: Linter
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
- branches: [ main ]
+ branches: [main]
# Always use latest Node.js version!
jobs:
+ lint-prettier:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18.x]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Node ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ - uses: actions/cache@v4
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+ - name: Install deps
+ run: npm install
+ - name: Lint with prettier
+ run: npx prettier . --check
lint-lib-xmlrpc:
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [ 18.x ]
+ node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
@@ -34,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [ 18.x ]
+ node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
@@ -55,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [ 18.x ]
+ node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
index e0f21fc7..a795215c 100644
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -2,9 +2,9 @@ name: Tests
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
- branches: [ main ]
+ branches: [main]
# Always use latest Node.js version!
@@ -97,7 +97,7 @@ jobs:
path: coverage/cobbler-frontend/lcov.info
if-no-files-found: error
e2e-cobbler-frontend:
- if: ${{ false }} # disable for now; we don't have e2e tests currently
+ if: ${{ false }} # disable for now; we don't have e2e tests currently
runs-on: ubuntu-latest
container:
image: timbru31/node-chrome
diff --git a/.gitpod.yml b/.gitpod.yml
index ea449728..0f9a1aa5 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -5,5 +5,3 @@
tasks:
- init: npm install && npm run build
command: npm run start
-
-
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..a40272c5
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,4 @@
+# Ignore artifacts:
+coverage
+dist
+node_modules
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index d4e1cd71..af1ad6ab 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:
-* Demonstrating empathy and kindness toward other people
-* Being respectful of differing opinions, viewpoints, and experiences
-* Giving and gracefully accepting constructive feedback
-* Accepting responsibility and apologizing to those affected by our mistakes,
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
-* Focusing on what is best not just for us as individuals, but for the
+- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
-* The use of sexualized language or imagery, and sexual attention or
+- The use of sexualized language or imagery, and sexual attention or
advances of any kind
-* Trolling, insulting or derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or email
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or email
address, without their explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
+- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
-standards, including sustained inappropriate behavior, harassment of an
+standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
diff --git a/README.md b/README.md
index 67287f69..ff1cc8df 100644
--- a/README.md
+++ b/README.md
@@ -10,9 +10,9 @@ Initial developer: [@nelliesnoodles](https://github.com/nelliesnoodles) & [@Scho
## Prerequisites
-* Node.js and npm
-* install Node.js dependencies with `npm install`
-* build required projects
+- Node.js and npm
+- install Node.js dependencies with `npm install`
+- build required projects
```shell
npm run build typescript-xmlrpc
diff --git a/angular.json b/angular.json
index c26f4f70..7e6897aa 100644
--- a/angular.json
+++ b/angular.json
@@ -205,7 +205,8 @@
}
},
"cli": {
- "schematicCollections": ["@angular-eslint/schematics"]
+ "schematicCollections": ["@angular-eslint/schematics"],
+ "analytics": false
},
"schematics": {
"@angular-eslint/schematics:application": {
diff --git a/docs-additonal/development-setup.md b/docs-additonal/development-setup.md
index 06ea5ab8..6818b637 100644
--- a/docs-additonal/development-setup.md
+++ b/docs-additonal/development-setup.md
@@ -22,7 +22,7 @@ This will give you a setup of both repositories of the main Git branches.
- Run the built image: `docker run -it --rm --name cobbler-dev -p 80:80 -p 443:443 -v ${PWD}:/code cobbler-dev`
- Execute the setup script in the running container: `./docker/develop/scripts/setup-supervisor.sh`
- Let the container run in the foreground! You may want to tail the Cobbler log:
- `tail -f /var/log/cobbler/cobbler.log`
+ `tail -f /var/log/cobbler/cobbler.log`
4. Go into the `cobbler-web` directory and follow these steps:
- Run an `npm install` to install the development and runtime dependencies.
- Build the TS-XMLRPC API via: `npm run build typescript-xmlrpc`
@@ -61,7 +61,6 @@ make clean
./docker/develop/scripts/setup-supervisor.sh
```
-
## Error handling
### CORS
diff --git a/package-lock.json b/package-lock.json
index cc29f010..a6e69e69 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42,6 +42,7 @@
"@typescript-eslint/parser": "^7.15.0",
"codecov": "^3.8.3",
"eslint": "^8.57.0",
+ "eslint-config-prettier": "^9.1.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~6.0.0",
"karma": "~6.3.12",
@@ -50,6 +51,8 @@
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"ng-packagr": "^17.3.0",
+ "prettier": "3.3.3",
+ "prettier-eslint": "^16.3.0",
"protractor": "~7.0.0",
"ts-node": "~9.1.1",
"typescript": "~5.4.5"
@@ -9140,6 +9143,16 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/common-tags": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
+ "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
"node_modules/commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -10137,6 +10150,13 @@
"node": ">=8"
}
},
+ "node_modules/dlv": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
+ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/dns-packet": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz",
@@ -10826,6 +10846,19 @@
"url": "https://opencollective.com/eslint"
}
},
+ "node_modules/eslint-config-prettier": {
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz",
+ "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "eslint-config-prettier": "bin/cli.js"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.0.0"
+ }
+ },
"node_modules/eslint-scope": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz",
@@ -14948,6 +14981,77 @@
"url": "https://tidelift.com/funding/github/npm/loglevel"
}
},
+ "node_modules/loglevel-colored-level-prefix": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz",
+ "integrity": "sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^1.1.3",
+ "loglevel": "^1.4.1"
+ }
+ },
+ "node_modules/loglevel-colored-level-prefix/node_modules/ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/loglevel-colored-level-prefix/node_modules/ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/loglevel-colored-level-prefix/node_modules/chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/loglevel-colored-level-prefix/node_modules/strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/loglevel-colored-level-prefix/node_modules/supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
"node_modules/loglevel-plugin-prefix": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz",
@@ -17319,6 +17423,166 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/prettier": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
+ "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/prettier-eslint": {
+ "version": "16.3.0",
+ "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-16.3.0.tgz",
+ "integrity": "sha512-Lh102TIFCr11PJKUMQ2kwNmxGhTsv/KzUg9QYF2Gkw259g/kPgndZDWavk7/ycbRvj2oz4BPZ1gCU8bhfZH/Xg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/parser": "^6.7.5",
+ "common-tags": "^1.4.0",
+ "dlv": "^1.1.0",
+ "eslint": "^8.7.0",
+ "indent-string": "^4.0.0",
+ "lodash.merge": "^4.6.0",
+ "loglevel-colored-level-prefix": "^1.0.0",
+ "prettier": "^3.0.1",
+ "pretty-format": "^29.7.0",
+ "require-relative": "^0.8.7",
+ "typescript": "^5.2.2",
+ "vue-eslint-parser": "^9.1.0"
+ },
+ "engines": {
+ "node": ">=16.10.0"
+ },
+ "peerDependencies": {
+ "prettier-plugin-svelte": "^3.0.0",
+ "svelte-eslint-parser": "*"
+ },
+ "peerDependenciesMeta": {
+ "prettier-plugin-svelte": {
+ "optional": true
+ },
+ "svelte-eslint-parser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/prettier-eslint/node_modules/@typescript-eslint/parser": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz",
+ "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "6.21.0",
+ "@typescript-eslint/types": "6.21.0",
+ "@typescript-eslint/typescript-estree": "6.21.0",
+ "@typescript-eslint/visitor-keys": "6.21.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/prettier-eslint/node_modules/@typescript-eslint/scope-manager": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz",
+ "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "6.21.0",
+ "@typescript-eslint/visitor-keys": "6.21.0"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/prettier-eslint/node_modules/@typescript-eslint/types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz",
+ "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/prettier-eslint/node_modules/@typescript-eslint/typescript-estree": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz",
+ "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@typescript-eslint/types": "6.21.0",
+ "@typescript-eslint/visitor-keys": "6.21.0",
+ "debug": "^4.3.4",
+ "globby": "^11.1.0",
+ "is-glob": "^4.0.3",
+ "minimatch": "9.0.3",
+ "semver": "^7.5.4",
+ "ts-api-utils": "^1.0.1"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/prettier-eslint/node_modules/@typescript-eslint/visitor-keys": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz",
+ "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "6.21.0",
+ "eslint-visitor-keys": "^3.4.1"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
"node_modules/pretty-format": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
@@ -18096,6 +18360,13 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/require-relative": {
+ "version": "0.8.7",
+ "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz",
+ "integrity": "sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
@@ -20822,6 +21093,48 @@
"node": ">=0.10.0"
}
},
+ "node_modules/vue-eslint-parser": {
+ "version": "9.4.3",
+ "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz",
+ "integrity": "sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.3.4",
+ "eslint-scope": "^7.1.1",
+ "eslint-visitor-keys": "^3.3.0",
+ "espree": "^9.3.1",
+ "esquery": "^1.4.0",
+ "lodash": "^4.17.21",
+ "semver": "^7.3.6"
+ },
+ "engines": {
+ "node": "^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mysticatea"
+ },
+ "peerDependencies": {
+ "eslint": ">=6.0.0"
+ }
+ },
+ "node_modules/vue-eslint-parser/node_modules/eslint-scope": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+ "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
"node_modules/watchpack": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
diff --git a/package.json b/package.json
index c212d362..d90cd950 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
"@typescript-eslint/parser": "^7.15.0",
"codecov": "^3.8.3",
"eslint": "^8.57.0",
+ "eslint-config-prettier": "^9.1.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~6.0.0",
"karma": "~6.3.12",
@@ -56,6 +57,8 @@
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"ng-packagr": "^17.3.0",
+ "prettier": "3.3.3",
+ "prettier-eslint": "^16.3.0",
"protractor": "~7.0.0",
"ts-node": "~9.1.1",
"typescript": "~5.4.5"
diff --git a/projects/cobbler-api/.eslintrc.json b/projects/cobbler-api/.eslintrc.json
index a256dcc5..b56db33e 100644
--- a/projects/cobbler-api/.eslintrc.json
+++ b/projects/cobbler-api/.eslintrc.json
@@ -1,13 +1,9 @@
{
"extends": "../../.eslintrc.json",
- "ignorePatterns": [
- "!**/*"
- ],
+ "ignorePatterns": ["!**/*"],
"overrides": [
{
- "files": [
- "*.ts"
- ],
+ "files": ["*.ts"],
"parserOptions": {
"project": [
"projects/cobbler-api/tsconfig.lib.json",
@@ -35,9 +31,7 @@
}
},
{
- "files": [
- "*.html"
- ],
+ "files": ["*.html"],
"rules": {}
}
]
diff --git a/projects/cobbler-api/README.md b/projects/cobbler-api/README.md
index 48cc1679..834798f5 100644
--- a/projects/cobbler-api/README.md
+++ b/projects/cobbler-api/README.md
@@ -5,7 +5,8 @@ This library was generated with [Angular CLI](https://github.com/angular/angular
## Code scaffolding
Run `ng generate component component-name --project cobbler-api` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project cobbler-api`.
-> Note: Don't forget to add `--project cobbler-api` or else it will be added to the default project in your `angular.json` file.
+
+> Note: Don't forget to add `--project cobbler-api` or else it will be added to the default project in your `angular.json` file.
## Build
diff --git a/projects/cobbler-api/karma.conf.js b/projects/cobbler-api/karma.conf.js
index 2434756a..e41db7fb 100644
--- a/projects/cobbler-api/karma.conf.js
+++ b/projects/cobbler-api/karma.conf.js
@@ -3,14 +3,14 @@
module.exports = function (config) {
config.set({
- basePath: '',
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
+ basePath: "",
+ frameworks: ["jasmine", "@angular-devkit/build-angular"],
plugins: [
- require('karma-jasmine'),
- require('karma-chrome-launcher'),
- require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require("karma-jasmine"),
+ require("karma-chrome-launcher"),
+ require("karma-jasmine-html-reporter"),
+ require("karma-coverage"),
+ require("@angular-devkit/build-angular/plugins/karma"),
],
client: {
jasmine: {
@@ -19,41 +19,38 @@ module.exports = function (config) {
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
- clearContext: false // leave Jasmine Spec Runner output visible in browser
+ clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
- suppressAll: true // removes the duplicated traces
+ suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
- dir: require('path').join(__dirname, '../../coverage/cobbler-api'),
- subdir: '.',
+ dir: require("path").join(__dirname, "../../coverage/cobbler-api"),
+ subdir: ".",
reporters: [
- { type: 'html' },
- { type: 'text-summary' },
- { type: 'lcovonly' },
- ]
+ { type: "html" },
+ { type: "text-summary" },
+ { type: "lcovonly" },
+ ],
},
- reporters: ['progress', 'kjhtml'],
+ reporters: ["progress", "kjhtml"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
- browsers: ['Chrome'],
+ browsers: ["Chrome"],
customLaunchers: {
Chrome_without_security: {
- base: 'Chrome',
- flags: ['--disable-web-security']
+ base: "Chrome",
+ flags: ["--disable-web-security"],
},
Headless: {
- base: 'ChromeHeadless',
- flags: [
- '--no-sandbox',
- '--disable-setuid-sandbox'
- ]
- }
+ base: "ChromeHeadless",
+ flags: ["--no-sandbox", "--disable-setuid-sandbox"],
+ },
},
singleRun: false,
- restartOnFileChange: true
+ restartOnFileChange: true,
});
- process.env.TZ = 'Europe/Berlin';
+ process.env.TZ = "Europe/Berlin";
};
diff --git a/projects/cobbler-api/ng-package.json b/projects/cobbler-api/ng-package.json
index 7433d45a..c065c5c9 100644
--- a/projects/cobbler-api/ng-package.json
+++ b/projects/cobbler-api/ng-package.json
@@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
-}
\ No newline at end of file
+}
diff --git a/projects/cobbler-api/package.json b/projects/cobbler-api/package.json
index 20ebef8c..5459ee1b 100644
--- a/projects/cobbler-api/package.json
+++ b/projects/cobbler-api/package.json
@@ -8,4 +8,4 @@
"dependencies": {
"tslib": "^2.0.0"
}
-}
\ No newline at end of file
+}
diff --git a/projects/cobbler-api/src/lib/cobbler-api.service.spec.ts b/projects/cobbler-api/src/lib/cobbler-api.service.spec.ts
index 846c6e58..33953b46 100644
--- a/projects/cobbler-api/src/lib/cobbler-api.service.spec.ts
+++ b/projects/cobbler-api/src/lib/cobbler-api.service.spec.ts
@@ -1,18 +1,30 @@
-import {TestBed} from '@angular/core/testing';
-import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
-import {Distro, File, Image, Mgmgtclass, Package, Profile, Repo, System} from './custom-types/items';
+import { TestBed } from '@angular/core/testing';
+import {
+ HttpClientTestingModule,
+ HttpTestingController,
+} from '@angular/common/http/testing';
+import {
+ Distro,
+ File,
+ Image,
+ Mgmgtclass,
+ Package,
+ Profile,
+ Repo,
+ System,
+} from './custom-types/items';
import {
BackgroundBuildisoOptions,
BackgroundImportOptions,
BackgroundReplicateOptions,
Event,
ExtendedVersion,
- InstallationStatus
+ InstallationStatus,
} from './custom-types/misc';
-import {COBBLER_URL} from './lib.config';
-import {AngularXmlrpcService} from 'typescript-xmlrpc';
+import { COBBLER_URL } from './lib.config';
+import { AngularXmlrpcService } from 'typescript-xmlrpc';
-import {CobblerApiService} from './cobbler-api.service';
+import { CobblerApiService } from './cobbler-api.service';
describe('CobblerApiService', () => {
let service: CobblerApiService;
@@ -24,17 +36,17 @@ describe('CobblerApiService', () => {
providers: [
{
provide: COBBLER_URL,
- useValue: new URL('http://localhost/cobbler_api')
+ useValue: new URL('http://localhost/cobbler_api'),
},
{
provide: AngularXmlrpcService,
- useClass: AngularXmlrpcService
+ useClass: AngularXmlrpcService,
},
{
provide: CobblerApiService,
- deps: [AngularXmlrpcService, COBBLER_URL]
- }
- ]
+ deps: [AngularXmlrpcService, COBBLER_URL],
+ },
+ ],
});
httpTestingController = TestBed.inject(HttpTestingController);
service = TestBed.inject(CobblerApiService);
@@ -56,11 +68,11 @@ describe('CobblerApiService', () => {
const result = [
// eslint-disable-next-line max-len
- 'The \'server\' field in /etc/cobbler/settings.yaml must be set to something other than localhost, or automatic installation features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.',
+ "The 'server' field in /etc/cobbler/settings.yaml must be set to something other than localhost, or automatic installation features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.",
// eslint-disable-next-line max-len
- 'For PXE to be functional, the \'next_server_v4\' field in /etc/cobbler/settings.yaml must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.',
+ "For PXE to be functional, the 'next_server_v4' field in /etc/cobbler/settings.yaml must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.",
// eslint-disable-next-line max-len
- 'For PXE to be functional, the \'next_server_v6\' field in /etc/cobbler/settings.yaml must be set to something other than ::1, and should match the IP of the boot server on the PXE network.',
+ "For PXE to be functional, the 'next_server_v6' field in /etc/cobbler/settings.yaml must be set to something other than ::1, and should match the IP of the boot server on the PXE network.",
'service cobblerd is not running',
// eslint-disable-next-line max-len
'some network boot-loaders are missing from /var/lib/cobbler/loaders. If you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, andmenu.c32.',
@@ -68,40 +80,43 @@ describe('CobblerApiService', () => {
'reposync not installed, install yum-utils',
'yumdownloader is not installed, install yum-utils',
// eslint-disable-next-line max-len
- 'The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings.yaml) is still set to \'cobbler\' and should be changed, try: "openssl passwd -1 -salt \'random-phrase-here\' \'your-password-here\'" to generate new one'
+ "The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings.yaml) is still set to 'cobbler' and should be changed, try: \"openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'\" to generate new one",
];
- service.check('').subscribe(
- value => {
- expect(value).toEqual(result);
- done();
- });
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ service.check('').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
+ });
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the background_buildiso action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41`
- const result = "2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41"
+ const methodResponse = `2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41`;
+ const result =
+ '2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41';
const buildisoOptions: BackgroundBuildisoOptions = {
- iso: "",
- profiles: "",
- systems: "",
- buildisodir: "",
- distro: "",
+ iso: '',
+ profiles: '',
+ systems: '',
+ buildisodir: '',
+ distro: '',
standalone: false,
airgapped: false,
- source: "",
+ source: '',
excludeDNS: false,
- xorrisofsOpts: "",
- }
+ xorrisofsOpts: '',
+ };
- service.background_buildiso(buildisoOptions, '').subscribe(
- value => {
- expect(value).toEqual(result);
- done();
- });
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ service.background_buildiso(buildisoOptions, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
+ });
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
@@ -122,69 +137,81 @@ describe('CobblerApiService', () => {
it('should execute the background_hardlink action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2022-09-30_203004_Hardlink_800c38f4e0424187aed6a6ffb6553ef8`
- const result = "2022-09-30_203004_Hardlink_800c38f4e0424187aed6a6ffb6553ef8"
- service.background_hardlink('').subscribe(value => {
- expect(value).toEqual(result)
+ const methodResponse = `2022-09-30_203004_Hardlink_800c38f4e0424187aed6a6ffb6553ef8`;
+ const result =
+ '2022-09-30_203004_Hardlink_800c38f4e0424187aed6a6ffb6553ef8';
+ service.background_hardlink('').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the background_mkloaders action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2022-09-30_203957_Create bootable bootloader images_9c809af4d6f148e49b071fac84f9a664`
- const result = "2022-09-30_203957_Create bootable bootloader images_9c809af4d6f148e49b071fac84f9a664"
- service.backgroundMkloaders('').subscribe(value => {
- expect(value).toEqual(result)
+ const methodResponse = `2022-09-30_203957_Create bootable bootloader images_9c809af4d6f148e49b071fac84f9a664`;
+ const result =
+ '2022-09-30_203957_Create bootable bootloader images_9c809af4d6f148e49b071fac84f9a664';
+ service.backgroundMkloaders('').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
- it('should execute the background_validate_autoinstall_files action on the Cobbler Server',
- () => {
- // eslint-disable-next-line max-len
- const methodResponse = `2022-09-30_203505_Automated installation files validation_487b1a5d1d914c62834126391ac2b601`
- const result = "2022-09-30_203505_Automated installation files validation_487b1a5d1d914c62834126391ac2b601"
- service.background_validate_autoinstall_files('').subscribe(value => {
- expect(value).toEqual(result)
- });
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
- mockRequest.flush(methodResponse);
+ it('should execute the background_validate_autoinstall_files action on the Cobbler Server', () => {
+ // eslint-disable-next-line max-len
+ const methodResponse = `2022-09-30_203505_Automated installation files validation_487b1a5d1d914c62834126391ac2b601`;
+ const result =
+ '2022-09-30_203505_Automated installation files validation_487b1a5d1d914c62834126391ac2b601';
+ service.background_validate_autoinstall_files('').subscribe((value) => {
+ expect(value).toEqual(result);
});
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
+ mockRequest.flush(methodResponse);
+ });
it('should execute the background_replicate action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a`
- const result = "2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a"
+ const methodResponse = `2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a`;
+ const result =
+ '2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a';
const replicateOptions: BackgroundReplicateOptions = {
- master: "",
- port: "",
- distro_patterns: "",
- profile_patterns: "",
- system_patterns: "",
- repo_patterns: "",
- image_patterns: "",
- mgmtclass_patterns: "",
- package_patterns: "",
- file_patterns: "",
+ master: '',
+ port: '',
+ distro_patterns: '',
+ profile_patterns: '',
+ system_patterns: '',
+ repo_patterns: '',
+ image_patterns: '',
+ mgmtclass_patterns: '',
+ package_patterns: '',
+ file_patterns: '',
prune: false,
omit_data: false,
sync_all: false,
use_ssl: false,
- }
- service.background_replicate(replicateOptions, '').subscribe(value => {
- expect(value).toEqual(result)
+ };
+ service.background_replicate(replicateOptions, '').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the background_import action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2023-01-24_103639_Media import_dd297121f7bc412e9ce4d80f05de4b3f`
- const result = "2023-01-24_103639_Media import_dd297121f7bc412e9ce4d80f05de4b3f"
+ const methodResponse = `2023-01-24_103639_Media import_dd297121f7bc412e9ce4d80f05de4b3f`;
+ const result =
+ '2023-01-24_103639_Media import_dd297121f7bc412e9ce4d80f05de4b3f';
const importOptions: BackgroundImportOptions = {
path: '',
name: '',
@@ -194,11 +221,13 @@ describe('CobblerApiService', () => {
arch: '',
breed: '',
os_version: '',
- }
- service.background_import(importOptions, '').subscribe(value => {
- expect(value).toEqual(result)
+ };
+ service.background_import(importOptions, '').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
@@ -219,52 +248,57 @@ describe('CobblerApiService', () => {
it('should execute the background_signature_update action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2022-09-30_195846_Updating Signatures_6c5300d51c224984b4319fb536cc21d0`
- const result = "2022-09-30_195846_Updating Signatures_6c5300d51c224984b4319fb536cc21d0"
- service.background_signature_update('').subscribe(value => {
- expect(value).toEqual(result)
+ const methodResponse = `2022-09-30_195846_Updating Signatures_6c5300d51c224984b4319fb536cc21d0`;
+ const result =
+ '2022-09-30_195846_Updating Signatures_6c5300d51c224984b4319fb536cc21d0';
+ service.background_signature_update('').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_events action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `2023-01-24_075223_Create bootable bootloader images_77c9dbafc9234f018d67ec3295fcc22b1674546743.8418643Create bootable bootloader imagescomplete1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a1674547081.1178503Replicatefailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb411674549001.176315Build Isofailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_083137_(CLI) ACL Configuration_334327920d2946fda3ac95dbf457e76d1674549097.240632(CLI) ACL Configurationfailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==`
- const result : Array = [
+ const methodResponse = `2023-01-24_075223_Create bootable bootloader images_77c9dbafc9234f018d67ec3295fcc22b1674546743.8418643Create bootable bootloader imagescomplete1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a1674547081.1178503Replicatefailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb411674549001.176315Build Isofailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==2023-01-24_083137_(CLI) ACL Configuration_334327920d2946fda3ac95dbf457e76d1674549097.240632(CLI) ACL Configurationfailed1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ==`;
+ const result: Array = [
{
- id: "2023-01-24_075223_Create bootable bootloader images_77c9dbafc9234f018d67ec3295fcc22b",
+ id: '2023-01-24_075223_Create bootable bootloader images_77c9dbafc9234f018d67ec3295fcc22b',
statetime: 1674546743.8418643,
- name: "Create bootable bootloader images",
- state: "complete",
- readByWho: ["1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=="]
+ name: 'Create bootable bootloader images',
+ state: 'complete',
+ readByWho: ['1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=='],
},
{
- id: "2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a",
+ id: '2023-01-24_075801_Replicate_ea7a003a81264039b4277ac55664661a',
statetime: 1674547081.1178503,
- name: "Replicate",
- state: "failed",
- readByWho: ["1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=="]
+ name: 'Replicate',
+ state: 'failed',
+ readByWho: ['1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=='],
},
{
- id: "2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41",
+ id: '2023-01-24_083001_Build Iso_20fa7d4256fc4f61a2b9c2237c80fb41',
statetime: 1674549001.176315,
- name: "Build Iso",
- state: "failed",
- readByWho: ["1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=="]
+ name: 'Build Iso',
+ state: 'failed',
+ readByWho: ['1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=='],
},
{
- id: "2023-01-24_083137_(CLI) ACL Configuration_334327920d2946fda3ac95dbf457e76d",
+ id: '2023-01-24_083137_(CLI) ACL Configuration_334327920d2946fda3ac95dbf457e76d',
statetime: 1674549097.240632,
- name: "(CLI) ACL Configuration",
- state: "failed",
- readByWho: ["1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=="]
- }
+ name: '(CLI) ACL Configuration',
+ state: 'failed',
+ readByWho: ['1YMw1KxyPQtPM8AVB5ejKFJryEHCtCwYQQ=='],
+ },
];
- service.get_events('').subscribe(value => {
- expect(value).toEqual(result)
+ service.get_events('').subscribe((value) => {
+ expect(value).toEqual(result);
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
@@ -297,31 +331,37 @@ describe('CobblerApiService', () => {
[2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29] 2022-09-30 14:51:24,962 - INFO | running post-sync triggers
[2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29] 2022-09-30 14:51:24,962 - INFO | running: ['dhcpd', '-t', '-q']
[2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29] 2022-09-30 14:51:25,002 - INFO | received on stdout:
-[2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29] 2022-09-30 14:51:26,044 - INFO | ### TASK COMPLETE ###`
+[2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29] 2022-09-30 14:51:26,044 - INFO | ### TASK COMPLETE ###`;
/* eslint-enable max-len */
- service.get_event_log('2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29').subscribe(value => [
- expect(value.split(/\r?\n/).length).toEqual(28)
- ]);
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ service
+ .get_event_log('2022-09-30_145124_Sync_2cabdc4eddfa4731b45f145d7b625e29')
+ .subscribe((value) => [expect(value.split(/\r?\n/).length).toEqual(28)]);
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_task_status action on the Cobbler Server', () => {
// eslint-disable-next-line max-len
- const methodResponse = `1664568243.5196018Updating Signaturescomplete`
+ const methodResponse = `1664568243.5196018Updating Signaturescomplete`;
const result = {
- id: "2022-09-30_200403_Updating Signatures_8f2b3c1626fb4b158636059b31242ee6",
+ id: '2022-09-30_200403_Updating Signatures_8f2b3c1626fb4b158636059b31242ee6',
statetime: 1664568243.5196018,
- name: "Updating Signatures",
- state: "complete",
- readByWho: []
- }
- service.get_task_status(
- '2022-09-30_200403_Updating Signatures_8f2b3c1626fb4b158636059b31242ee6'
- ).subscribe(value => {
- expect(value).toEqual(result)
- });
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ name: 'Updating Signatures',
+ state: 'complete',
+ readByWho: [],
+ };
+ service
+ .get_task_status(
+ '2022-09-30_200403_Updating Signatures_8f2b3c1626fb4b158636059b31242ee6',
+ )
+ .subscribe((value) => {
+ expect(value).toEqual(result);
+ });
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
@@ -347,157 +387,161 @@ describe('CobblerApiService', () => {
it('should execute the get_distro action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480439.039089mtime1721480439.039089uid12f034d6781946d1af0783e20684cbd4nametestcommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classesmgmt_parametersis_subobject0tree_build_time0.0archx86_64boot_loaders<<inherit>>breedinitrd/root/initrdkernel/root/kernelos_versionredhat_management_key<<inherit>>source_reposremote_boot_kernelremote_grub_kernelremote_boot_initrdremote_grub_initrdks_meta`
+ const methodResponse = `parentdepth0ctime1721480439.039089mtime1721480439.039089uid12f034d6781946d1af0783e20684cbd4nametestcommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classesmgmt_parametersis_subobject0tree_build_time0.0archx86_64boot_loaders<<inherit>>breedinitrd/root/initrdkernel/root/kernelos_versionredhat_management_key<<inherit>>source_reposremote_boot_kernelremote_grub_kernelremote_boot_initrdremote_grub_initrdks_meta`;
const result: Distro = {
ctime: 1721480439.039089,
depth: 0,
mtime: 1721480439.039089,
- uid: "12f034d6781946d1af0783e20684cbd4",
+ uid: '12f034d6781946d1af0783e20684cbd4',
source_repos: [],
tree_build_time: 0,
- arch: "x86_64",
+ arch: 'x86_64',
autoinstall_meta: {},
boot_files: {},
- boot_loaders: "<>",
+ boot_loaders: '<>',
is_subobject: false,
- parent: "",
- breed: "",
- comment: "",
+ parent: '',
+ breed: '',
+ comment: '',
fetchable_files: {},
- initrd: "/root/initrd",
- kernel: "/root/kernel",
- remote_boot_initrd: "",
- remote_boot_kernel: "",
- remote_grub_initrd: "",
- remote_grub_kernel: "",
+ initrd: '/root/initrd',
+ kernel: '/root/kernel',
+ remote_boot_initrd: '',
+ remote_boot_kernel: '',
+ remote_grub_initrd: '',
+ remote_grub_kernel: '',
kernel_options: {},
kernel_options_post: {},
mgmt_classes: [],
mgmt_parameters: {},
- name: "test",
- os_version: "",
- owners: "<>",
- redhat_management_key: "<>",
+ name: 'test',
+ os_version: '',
+ owners: '<>',
+ redhat_management_key: '<>',
template_files: {},
- }
- service.get_distro('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_distro('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_profile action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth1ctime1721480439.3090012mtime1721480439.3090012uid5f01667614244fcd9c7ca7fa59c7def1nametestprofcommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0autoinstall<<inherit>>boot_loaders<<inherit>>dhcp_tagdistrotestenable_ipxe<<inherit>>enable_menu<<inherit>>name_serversname_servers_searchnext_server_v4<<inherit>>next_server_v6<<inherit>>filenameproxy<<inherit>>redhat_management_key<<inherit>>reposserver<<inherit>>menuvirt_auto_boot<<inherit>>virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_typexenpvkickstart<<inherit>>ks_meta<<inherit>>`
+ const methodResponse = `parentdepth1ctime1721480439.3090012mtime1721480439.3090012uid5f01667614244fcd9c7ca7fa59c7def1nametestprofcommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0autoinstall<<inherit>>boot_loaders<<inherit>>dhcp_tagdistrotestenable_ipxe<<inherit>>enable_menu<<inherit>>name_serversname_servers_searchnext_server_v4<<inherit>>next_server_v6<<inherit>>filenameproxy<<inherit>>redhat_management_key<<inherit>>reposserver<<inherit>>menuvirt_auto_boot<<inherit>>virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_typexenpvkickstart<<inherit>>ks_meta<<inherit>>`;
const result: Profile = {
- name: "testprof",
+ name: 'testprof',
depth: 1,
mtime: 1721480439.3090012,
is_subobject: false,
- boot_loaders: "<>",
- autoinstall_meta: "<>",
- server: "<>",
- distro: "test",
- comment: "",
- next_server_v4: "<>",
- next_server_v6: "<>",
- enable_ipxe: "<>",
- parent: "",
- owners: "<>",
- autoinstall: "<>",
- uid: "5f01667614244fcd9c7ca7fa59c7def1",
- virt_ram: "<>",
- boot_files: "<>",
- mgmt_parameters: "<>",
+ boot_loaders: '<>',
+ autoinstall_meta: '<>',
+ server: '<>',
+ distro: 'test',
+ comment: '',
+ next_server_v4: '<>',
+ next_server_v6: '<>',
+ enable_ipxe: '<>',
+ parent: '',
+ owners: '<>',
+ autoinstall: '<>',
+ uid: '5f01667614244fcd9c7ca7fa59c7def1',
+ virt_ram: '<>',
+ boot_files: '<>',
+ mgmt_parameters: '<>',
name_servers: [],
- enable_menu: "<>",
- menu: "",
+ enable_menu: '<>',
+ menu: '',
ctime: 1721480439.3090012,
- fetchable_files: "<>",
- mgmt_classes: "<>",
- kernel_options: "<>",
- virt_auto_boot: "<>",
- kernel_options_post: "<>",
- proxy: "<>",
- filename: "",
- dhcp_tag: "",
- redhat_management_key: "<>",
+ fetchable_files: '<>',
+ mgmt_classes: '<>',
+ kernel_options: '<>',
+ virt_auto_boot: '<>',
+ kernel_options_post: '<>',
+ proxy: '<>',
+ filename: '',
+ dhcp_tag: '',
+ redhat_management_key: '<>',
repos: [],
template_files: {},
- virt_type: "xenpv",
+ virt_type: 'xenpv',
virt_cpus: 1,
- virt_bridge: "<>",
+ virt_bridge: '<>',
name_servers_search: [],
- virt_path: "",
- virt_file_size: "<>",
- virt_disk_driver: "raw",
- }
- service.get_profile('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ virt_path: '',
+ virt_file_size: '<>',
+ virt_disk_driver: 'raw',
+ };
+ service.get_profile('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_system action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth2ctime1721480439.5932038mtime1721480439.5932038uida3320bc9105c44f1b92ab1743d460ed8nametestsyscommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0interfacesdefaultbonding_optsbridge_optscnamesconnected_mode0dhcp_tagdns_nameif_gatewayinterface_masterinterface_typenaip_addressipv6_addressipv6_default_gatewayipv6_mtuipv6_prefixipv6_secondariesipv6_static_routesmac_addressmanagement0mtunetmaskstatic0static_routesvirt_bridge<<inherit>>ipv6_autoconfiguration0repos_enabled0autoinstall<<inherit>>boot_loaders<<inherit>>enable_ipxe<<inherit>>gatewayhostnameimageipv6_default_devicename_serversname_servers_searchnetboot_enabled0next_server_v4<<inherit>>next_server_v6<<inherit>>filename<<inherit>>power_addresspower_idpower_passpower_typepower_userpower_optionspower_identity_fileprofiletestprofproxy<<inherit>>redhat_management_key<<inherit>>server<<inherit>>statusvirt_auto_boot<<inherit>>virt_cpus<<inherit>>virt_disk_driver<<inherit>>virt_file_size<<inherit>>virt_path<<inherit>>virt_pxe_boot0virt_ram<<inherit>>virt_type<<inherit>>serial_device-1serial_baud_rate-1kickstart<<inherit>>ks_meta<<inherit>>`
+ const methodResponse = `parentdepth2ctime1721480439.5932038mtime1721480439.5932038uida3320bc9105c44f1b92ab1743d460ed8nametestsyscommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0interfacesdefaultbonding_optsbridge_optscnamesconnected_mode0dhcp_tagdns_nameif_gatewayinterface_masterinterface_typenaip_addressipv6_addressipv6_default_gatewayipv6_mtuipv6_prefixipv6_secondariesipv6_static_routesmac_addressmanagement0mtunetmaskstatic0static_routesvirt_bridge<<inherit>>ipv6_autoconfiguration0repos_enabled0autoinstall<<inherit>>boot_loaders<<inherit>>enable_ipxe<<inherit>>gatewayhostnameimageipv6_default_devicename_serversname_servers_searchnetboot_enabled0next_server_v4<<inherit>>next_server_v6<<inherit>>filename<<inherit>>power_addresspower_idpower_passpower_typepower_userpower_optionspower_identity_fileprofiletestprofproxy<<inherit>>redhat_management_key<<inherit>>server<<inherit>>statusvirt_auto_boot<<inherit>>virt_cpus<<inherit>>virt_disk_driver<<inherit>>virt_file_size<<inherit>>virt_path<<inherit>>virt_pxe_boot0virt_ram<<inherit>>virt_type<<inherit>>serial_device-1serial_baud_rate-1kickstart<<inherit>>ks_meta<<inherit>>`;
const result: System = {
ctime: 1721480439.5932038,
mtime: 1721480439.5932038,
- name: "testsys",
+ name: 'testsys',
depth: 2,
- comment: "",
- owners: "<>",
- uid: "a3320bc9105c44f1b92ab1743d460ed8",
- autoinstall: "<>",
- boot_files: "<>",
- boot_loaders: "<>",
- parent: "",
+ comment: '',
+ owners: '<>',
+ uid: 'a3320bc9105c44f1b92ab1743d460ed8',
+ autoinstall: '<>',
+ boot_files: '<>',
+ boot_loaders: '<>',
+ parent: '',
is_subobject: false,
- autoinstall_meta: "<>",
- enable_ipxe: "<>",
- fetchable_files: "<>",
- filename: "<>",
- gateway: "",
- hostname: "",
- image: "",
+ autoinstall_meta: '<>',
+ enable_ipxe: '<>',
+ fetchable_files: '<>',
+ filename: '<>',
+ gateway: '',
+ hostname: '',
+ image: '',
ipv6_autoconfiguration: false,
- ipv6_default_device: "",
- kernel_options: "<>",
- kernel_options_post: "<>",
- mgmt_classes: "<>",
- mgmt_parameters: "<>",
+ ipv6_default_device: '',
+ kernel_options: '<>',
+ kernel_options_post: '<>',
+ mgmt_classes: '<>',
+ mgmt_parameters: '<>',
name_servers: [],
name_servers_search: [],
netboot_enabled: false,
- next_server_v4: "<>",
- next_server_v6: "<>",
- power_address: "",
- power_id: "",
- power_identity_file: "",
- power_options: "",
- power_pass: "",
- power_type: "",
- power_user: "",
- profile: "testprof",
- proxy: "<>",
- redhat_management_key: "<>",
+ next_server_v4: '<>',
+ next_server_v6: '<>',
+ power_address: '',
+ power_id: '',
+ power_identity_file: '',
+ power_options: '',
+ power_pass: '',
+ power_type: '',
+ power_user: '',
+ profile: 'testprof',
+ proxy: '<>',
+ redhat_management_key: '<>',
repos_enabled: false,
- server: "<>",
+ server: '<>',
serial_baud_rate: -1,
- serial_device : -1,
- status: "",
- virt_auto_boot: "<>",
- virt_disk_driver: "<>",
- virt_path: "<>",
- virt_ram: "<>",
- virt_type: "<>",
- virt_file_size: "<>",
- virt_cpus: "<>",
+ serial_device: -1,
+ status: '',
+ virt_auto_boot: '<>',
+ virt_disk_driver: '<>',
+ virt_path: '<>',
+ virt_ram: '<>',
+ virt_type: '<>',
+ virt_file_size: '<>',
+ virt_cpus: '<>',
virt_pxe_boot: false,
template_files: {},
interfaces: {
@@ -525,129 +569,135 @@ describe('CobblerApiService', () => {
static: false,
static_routes: [],
virt_bridge: '<>',
- }
+ },
},
- }
- service.get_system('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_system('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_repo action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480440.9711354mtime1721480440.9711354uid8b58f9b09a3e4d28965160d97a5de482nametestrepocommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0breednonearchnoneenvironmentyumoptsrsyncoptsmirror_typebaseurlapt_componentsapt_distscreaterepo_flags<<inherit>>keep_updated0mirrormirror_locally0priority0proxy<<inherit>>rpm_listos_versionks_meta`
+ const methodResponse = `parentdepth0ctime1721480440.9711354mtime1721480440.9711354uid8b58f9b09a3e4d28965160d97a5de482nametestrepocommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0breednonearchnoneenvironmentyumoptsrsyncoptsmirror_typebaseurlapt_componentsapt_distscreaterepo_flags<<inherit>>keep_updated0mirrormirror_locally0priority0proxy<<inherit>>rpm_listos_versionks_meta`;
const result: Repo = {
ctime: 1721480440.9711354,
mtime: 1721480440.9711354,
- name: "testrepo",
+ name: 'testrepo',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "8b58f9b09a3e4d28965160d97a5de482",
+ comment: '',
+ owners: '<>',
+ uid: '8b58f9b09a3e4d28965160d97a5de482',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
- arch: "none",
- breed: "none",
+ arch: 'none',
+ breed: 'none',
apt_components: [],
apt_dists: [],
- mirror: "",
+ mirror: '',
rsyncopts: {},
- proxy: "<>",
- createrepo_flags: "<>",
+ proxy: '<>',
+ createrepo_flags: '<>',
environment: {},
keep_updated: false,
mirror_locally: false,
- mirror_type: "baseurl",
+ mirror_type: 'baseurl',
priority: 0,
rpm_list: [],
yumopts: {},
autoinstall_meta: {},
boot_files: {},
- os_version: "",
+ os_version: '',
template_files: {},
- }
- service.get_repo('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_repo('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_image action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480441.493743mtime1721480441.493743uid911577c3691b4294acdf017e7f15f4cfnametestimagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0archx86_64autoinstall<<inherit>>breedfileimage_typedirectnetwork_count0os_versionboot_loadersmenuvirt_auto_boot0virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_type<<inherit>>kickstart<<inherit>>ks_meta`
+ const methodResponse = `parentdepth0ctime1721480441.493743mtime1721480441.493743uid911577c3691b4294acdf017e7f15f4cfnametestimagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0archx86_64autoinstall<<inherit>>breedfileimage_typedirectnetwork_count0os_versionboot_loadersmenuvirt_auto_boot0virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_type<<inherit>>kickstart<<inherit>>ks_meta`;
const result: Image = {
ctime: 1721480441.493743,
mtime: 1721480441.493743,
- name: "testimage",
+ name: 'testimage',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "911577c3691b4294acdf017e7f15f4cf",
- arch: "x86_64",
- breed: "",
- file: "",
+ comment: '',
+ owners: '<>',
+ uid: '911577c3691b4294acdf017e7f15f4cf',
+ arch: 'x86_64',
+ breed: '',
+ file: '',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
- autoinstall: "<>",
- image_type: "direct",
+ autoinstall: '<>',
+ image_type: 'direct',
network_count: 0,
- os_version: "",
+ os_version: '',
virt_auto_boot: false,
- virt_bridge: "<>",
+ virt_bridge: '<>',
virt_cpus: 1,
- virt_disk_driver: "raw",
- virt_file_size: "<>",
- virt_path: "",
- virt_ram: "<>",
- virt_type: "<>",
- menu: "",
+ virt_disk_driver: 'raw',
+ virt_file_size: '<>',
+ virt_path: '',
+ virt_ram: '<>',
+ virt_type: '<>',
+ menu: '',
autoinstall_meta: {},
boot_files: {},
boot_loaders: [],
template_files: {},
- }
- service.get_image('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_image('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_mgmtclass action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480442.0213087mtime1721480442.0213087uid5a4898be6fca4d7884898fa60a64e6dcnametestmgmtclasscommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0is_definition0paramsclass_namefilespackagesks_meta`
+ const methodResponse = `parentdepth0ctime1721480442.0213087mtime1721480442.0213087uid5a4898be6fca4d7884898fa60a64e6dcnametestmgmtclasscommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0is_definition0paramsclass_namefilespackagesks_meta`;
const result: Mgmgtclass = {
ctime: 1721480442.0213087,
mtime: 1721480442.0213087,
- name: "testmgmtclass",
+ name: 'testmgmtclass',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "5a4898be6fca4d7884898fa60a64e6dc",
+ comment: '',
+ owners: '<>',
+ uid: '5a4898be6fca4d7884898fa60a64e6dc',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
- class_name: "",
+ class_name: '',
files: [],
is_definition: false,
packages: [],
@@ -655,87 +705,93 @@ describe('CobblerApiService', () => {
autoinstall_meta: {},
boot_files: {},
template_files: {},
- }
- service.get_mgmtclass('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_mgmtclass('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_package action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480441.7595894mtime1721480441.7595894uida6d7ee9851d74f73b9f393f89efd4caenametestpackagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0actioncreatemodeownergrouppathtemplateinstallerversionks_meta`
+ const methodResponse = `parentdepth0ctime1721480441.7595894mtime1721480441.7595894uida6d7ee9851d74f73b9f393f89efd4caenametestpackagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0actioncreatemodeownergrouppathtemplateinstallerversionks_meta`;
const result: Package = {
ctime: 1721480441.7595894,
mtime: 1721480441.7595894,
- name: "testpackage",
+ name: 'testpackage',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "a6d7ee9851d74f73b9f393f89efd4cae",
- action: "create",
- installer: "",
- version: "",
- mode: "",
- group: "",
- owner: "",
- path: "",
- template: "",
+ comment: '',
+ owners: '<>',
+ uid: 'a6d7ee9851d74f73b9f393f89efd4cae',
+ action: 'create',
+ installer: '',
+ version: '',
+ mode: '',
+ group: '',
+ owner: '',
+ path: '',
+ template: '',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
boot_files: {},
autoinstall_meta: {},
template_files: {},
- }
- service.get_package('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ };
+ service.get_package('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_file action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480443.0627294mtime1721480443.0627294uid650659dad2694598a14632f4a434c4a9nametestfilecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0actioncreatemode0644ownerrootgrouprootpath/root/testfiletemplate/etc/cobbler/dhcp.templateis_dir0ks_meta`
+ const methodResponse = `parentdepth0ctime1721480443.0627294mtime1721480443.0627294uid650659dad2694598a14632f4a434c4a9nametestfilecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0actioncreatemode0644ownerrootgrouprootpath/root/testfiletemplate/etc/cobbler/dhcp.templateis_dir0ks_meta`;
const result: File = {
ctime: 1721480443.0627294,
mtime: 1721480443.0627294,
- name: "testfile",
+ name: 'testfile',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "650659dad2694598a14632f4a434c4a9",
- owner: "root",
- action: "create",
- group: "root",
+ comment: '',
+ owners: '<>',
+ uid: '650659dad2694598a14632f4a434c4a9',
+ owner: 'root',
+ action: 'create',
+ group: 'root',
is_dir: false,
- mode: "0644",
- path: "/root/testfile",
- template: "/etc/cobbler/dhcp.template",
+ mode: '0644',
+ path: '/root/testfile',
+ template: '/etc/cobbler/dhcp.template',
fetchable_files: {},
is_subobject: false,
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
template_files: {},
autoinstall_meta: {},
boot_files: {},
- parent: "",
- }
- service.get_file('', false, false, "").subscribe(value => {
- expect(value).toEqual(result)
- done()
+ parent: '',
+ };
+ service.get_file('', false, false, '').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
@@ -746,174 +802,180 @@ describe('CobblerApiService', () => {
it('should execute the get_item_names action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `testdistro`
- const result = ["testdistro"]
- service.get_item_names('distro').subscribe(value => {
- expect(value).toEqual(result)
- done()
+ const methodResponse = `testdistro`;
+ const result = ['testdistro'];
+ service.get_item_names('distro').subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_distros action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480439.039089mtime1721480439.039089uid12f034d6781946d1af0783e20684cbd4nametestcommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classesmgmt_parametersis_subobject0tree_build_time0.0archx86_64boot_loaders<<inherit>>breedinitrd/root/initrdkernel/root/kernelos_versionredhat_management_key<<inherit>>source_reposremote_boot_kernelremote_grub_kernelremote_boot_initrdremote_grub_initrdks_meta`
+ const methodResponse = `parentdepth0ctime1721480439.039089mtime1721480439.039089uid12f034d6781946d1af0783e20684cbd4nametestcommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classesmgmt_parametersis_subobject0tree_build_time0.0archx86_64boot_loaders<<inherit>>breedinitrd/root/initrdkernel/root/kernelos_versionredhat_management_key<<inherit>>source_reposremote_boot_kernelremote_grub_kernelremote_boot_initrdremote_grub_initrdks_meta`;
const result: Array = [
{
ctime: 1721480439.039089,
depth: 0,
mtime: 1721480439.039089,
- uid: "12f034d6781946d1af0783e20684cbd4",
+ uid: '12f034d6781946d1af0783e20684cbd4',
source_repos: [],
tree_build_time: 0,
- arch: "x86_64",
+ arch: 'x86_64',
autoinstall_meta: {},
boot_files: {},
- boot_loaders: "<>",
+ boot_loaders: '<>',
is_subobject: false,
- parent: "",
- breed: "",
- comment: "",
+ parent: '',
+ breed: '',
+ comment: '',
fetchable_files: {},
- initrd: "/root/initrd",
- kernel: "/root/kernel",
- remote_boot_initrd: "",
- remote_boot_kernel: "",
- remote_grub_initrd: "",
- remote_grub_kernel: "",
+ initrd: '/root/initrd',
+ kernel: '/root/kernel',
+ remote_boot_initrd: '',
+ remote_boot_kernel: '',
+ remote_grub_initrd: '',
+ remote_grub_kernel: '',
kernel_options: {},
kernel_options_post: {},
mgmt_classes: [],
mgmt_parameters: {},
- name: "test",
- os_version: "",
- owners: "<>",
- redhat_management_key: "<>",
- template_files: {}
- }
- ]
- service.get_distros().subscribe(value => {
- expect(value).toEqual(result)
- done()
+ name: 'test',
+ os_version: '',
+ owners: '<>',
+ redhat_management_key: '<>',
+ template_files: {},
+ },
+ ];
+ service.get_distros().subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_profiles action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth1ctime1721480439.3090012mtime1721480439.3090012uid5f01667614244fcd9c7ca7fa59c7def1nametestprofcommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0autoinstall<<inherit>>boot_loaders<<inherit>>dhcp_tagdistrotestenable_ipxe<<inherit>>enable_menu<<inherit>>name_serversname_servers_searchnext_server_v4<<inherit>>next_server_v6<<inherit>>filenameproxy<<inherit>>redhat_management_key<<inherit>>reposserver<<inherit>>menuvirt_auto_boot<<inherit>>virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_typexenpvkickstart<<inherit>>ks_meta<<inherit>>`
+ const methodResponse = `parentdepth1ctime1721480439.3090012mtime1721480439.3090012uid5f01667614244fcd9c7ca7fa59c7def1nametestprofcommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0autoinstall<<inherit>>boot_loaders<<inherit>>dhcp_tagdistrotestenable_ipxe<<inherit>>enable_menu<<inherit>>name_serversname_servers_searchnext_server_v4<<inherit>>next_server_v6<<inherit>>filenameproxy<<inherit>>redhat_management_key<<inherit>>reposserver<<inherit>>menuvirt_auto_boot<<inherit>>virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_typexenpvkickstart<<inherit>>ks_meta<<inherit>>`;
const result: Array = [
{
- name: "testprof",
+ name: 'testprof',
depth: 1,
mtime: 1721480439.3090012,
is_subobject: false,
- boot_loaders: "<>",
- autoinstall_meta: "<>",
- server: "<>",
- distro: "test",
- comment: "",
- next_server_v4: "<>",
- next_server_v6: "<>",
- enable_ipxe: "<>",
- parent: "",
- owners: "<>",
- autoinstall: "<>",
- uid: "5f01667614244fcd9c7ca7fa59c7def1",
- virt_ram: "<>",
- boot_files: "<>",
- mgmt_parameters: "<>",
+ boot_loaders: '<>',
+ autoinstall_meta: '<>',
+ server: '<>',
+ distro: 'test',
+ comment: '',
+ next_server_v4: '<>',
+ next_server_v6: '<>',
+ enable_ipxe: '<>',
+ parent: '',
+ owners: '<>',
+ autoinstall: '<>',
+ uid: '5f01667614244fcd9c7ca7fa59c7def1',
+ virt_ram: '<>',
+ boot_files: '<>',
+ mgmt_parameters: '<>',
name_servers: [],
- enable_menu: "<>",
- menu: "",
+ enable_menu: '<>',
+ menu: '',
ctime: 1721480439.3090012,
- fetchable_files: "<>",
- mgmt_classes: "<>",
- kernel_options: "<>",
- virt_auto_boot: "<>",
- kernel_options_post: "<>",
- proxy: "<>",
- filename: "",
- dhcp_tag: "",
- redhat_management_key: "<>",
+ fetchable_files: '<>',
+ mgmt_classes: '<>',
+ kernel_options: '<>',
+ virt_auto_boot: '<>',
+ kernel_options_post: '<>',
+ proxy: '<>',
+ filename: '',
+ dhcp_tag: '',
+ redhat_management_key: '<>',
repos: [],
template_files: {},
- virt_type: "xenpv",
+ virt_type: 'xenpv',
virt_cpus: 1,
- virt_bridge: "<>",
+ virt_bridge: '<>',
name_servers_search: [],
- virt_path: "",
- virt_file_size: "<>",
- virt_disk_driver: "raw",
- }
- ]
- service.get_profiles().subscribe(value => {
- expect(value).toEqual(result)
- done()
+ virt_path: '',
+ virt_file_size: '<>',
+ virt_disk_driver: 'raw',
+ },
+ ];
+ service.get_profiles().subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_systems action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth2ctime1721480439.5932038mtime1721480439.5932038uida3320bc9105c44f1b92ab1743d460ed8nametestsyscommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0interfacesdefaultbonding_optsbridge_optscnamesconnected_mode0dhcp_tagdns_nameif_gatewayinterface_masterinterface_typenaip_addressipv6_addressipv6_default_gatewayipv6_mtuipv6_prefixipv6_secondariesipv6_static_routesmac_addressmanagement0mtunetmaskstatic0static_routesvirt_bridge<<inherit>>ipv6_autoconfiguration0repos_enabled0autoinstall<<inherit>>boot_loaders<<inherit>>enable_ipxe<<inherit>>gatewayhostnameimageipv6_default_devicename_serversname_servers_searchnetboot_enabled0next_server_v4<<inherit>>next_server_v6<<inherit>>filename<<inherit>>power_addresspower_idpower_passpower_typepower_userpower_optionspower_identity_fileprofiletestprofproxy<<inherit>>redhat_management_key<<inherit>>server<<inherit>>statusvirt_auto_boot<<inherit>>virt_cpus<<inherit>>virt_disk_driver<<inherit>>virt_file_size<<inherit>>virt_path<<inherit>>virt_pxe_boot0virt_ram<<inherit>>virt_type<<inherit>>serial_device-1serial_baud_rate-1kickstart<<inherit>>ks_meta<<inherit>>`
+ const methodResponse = `parentdepth2ctime1721480439.5932038mtime1721480439.5932038uida3320bc9105c44f1b92ab1743d460ed8nametestsyscommentkernel_options<<inherit>>kernel_options_post<<inherit>>autoinstall_meta<<inherit>>fetchable_files<<inherit>>boot_files<<inherit>>template_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parameters<<inherit>>is_subobject0interfacesdefaultbonding_optsbridge_optscnamesconnected_mode0dhcp_tagdns_nameif_gatewayinterface_masterinterface_typenaip_addressipv6_addressipv6_default_gatewayipv6_mtuipv6_prefixipv6_secondariesipv6_static_routesmac_addressmanagement0mtunetmaskstatic0static_routesvirt_bridge<<inherit>>ipv6_autoconfiguration0repos_enabled0autoinstall<<inherit>>boot_loaders<<inherit>>enable_ipxe<<inherit>>gatewayhostnameimageipv6_default_devicename_serversname_servers_searchnetboot_enabled0next_server_v4<<inherit>>next_server_v6<<inherit>>filename<<inherit>>power_addresspower_idpower_passpower_typepower_userpower_optionspower_identity_fileprofiletestprofproxy<<inherit>>redhat_management_key<<inherit>>server<<inherit>>statusvirt_auto_boot<<inherit>>virt_cpus<<inherit>>virt_disk_driver<<inherit>>virt_file_size<<inherit>>virt_path<<inherit>>virt_pxe_boot0virt_ram<<inherit>>virt_type<<inherit>>serial_device-1serial_baud_rate-1kickstart<<inherit>>ks_meta<<inherit>>`;
const result: Array = [
{
ctime: 1721480439.5932038,
mtime: 1721480439.5932038,
- name: "testsys",
+ name: 'testsys',
depth: 2,
- comment: "",
- owners: "<>",
- uid: "a3320bc9105c44f1b92ab1743d460ed8",
- autoinstall: "<>",
- boot_files: "<>",
- boot_loaders: "<>",
- parent: "",
+ comment: '',
+ owners: '<>',
+ uid: 'a3320bc9105c44f1b92ab1743d460ed8',
+ autoinstall: '<>',
+ boot_files: '<>',
+ boot_loaders: '<>',
+ parent: '',
is_subobject: false,
- autoinstall_meta: "<>",
- enable_ipxe: "<>",
- fetchable_files: "<>",
- filename: "<>",
- gateway: "",
- hostname: "",
- image: "",
+ autoinstall_meta: '<>',
+ enable_ipxe: '<>',
+ fetchable_files: '<>',
+ filename: '<>',
+ gateway: '',
+ hostname: '',
+ image: '',
ipv6_autoconfiguration: false,
- ipv6_default_device: "",
- kernel_options: "<>",
- kernel_options_post: "<>",
- mgmt_classes: "<>",
- mgmt_parameters: "<>",
+ ipv6_default_device: '',
+ kernel_options: '<>',
+ kernel_options_post: '<>',
+ mgmt_classes: '<>',
+ mgmt_parameters: '<>',
name_servers: [],
name_servers_search: [],
netboot_enabled: false,
- next_server_v4: "<>",
- next_server_v6: "<>",
- power_address: "",
- power_id: "",
- power_identity_file: "",
- power_options: "",
- power_pass: "",
- power_type: "",
- power_user: "",
- profile: "testprof",
- proxy: "<>",
- redhat_management_key: "<>",
+ next_server_v4: '<>',
+ next_server_v6: '<>',
+ power_address: '',
+ power_id: '',
+ power_identity_file: '',
+ power_options: '',
+ power_pass: '',
+ power_type: '',
+ power_user: '',
+ profile: 'testprof',
+ proxy: '<>',
+ redhat_management_key: '<>',
repos_enabled: false,
- server: "<>",
+ server: '<>',
serial_baud_rate: -1,
serial_device: -1,
- status: "",
- virt_auto_boot: "<>",
- virt_disk_driver: "<>",
- virt_path: "<>",
- virt_ram: "<>",
- virt_type: "<>",
- virt_file_size: "<>",
- virt_cpus: "<>",
+ status: '',
+ virt_auto_boot: '<>',
+ virt_disk_driver: '<>',
+ virt_path: '<>',
+ virt_ram: '<>',
+ virt_type: '<>',
+ virt_file_size: '<>',
+ virt_cpus: '<>',
virt_pxe_boot: false,
template_files: {},
interfaces: {
@@ -941,135 +1003,141 @@ describe('CobblerApiService', () => {
static: false,
static_routes: [],
virt_bridge: '<>',
- }
- }
- }
- ]
- service.get_systems().subscribe(value => {
- expect(value).toEqual(result)
- done()
+ },
+ },
+ },
+ ];
+ service.get_systems().subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_repos action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480440.9711354mtime1721480440.9711354uid8b58f9b09a3e4d28965160d97a5de482nametestrepocommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0breednonearchnoneenvironmentyumoptsrsyncoptsmirror_typebaseurlapt_componentsapt_distscreaterepo_flags<<inherit>>keep_updated0mirrormirror_locally0priority0proxy<<inherit>>rpm_listos_versionks_meta`
+ const methodResponse = `parentdepth0ctime1721480440.9711354mtime1721480440.9711354uid8b58f9b09a3e4d28965160d97a5de482nametestrepocommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0breednonearchnoneenvironmentyumoptsrsyncoptsmirror_typebaseurlapt_componentsapt_distscreaterepo_flags<<inherit>>keep_updated0mirrormirror_locally0priority0proxy<<inherit>>rpm_listos_versionks_meta`;
const result: Array = [
{
ctime: 1721480440.9711354,
mtime: 1721480440.9711354,
- name: "testrepo",
+ name: 'testrepo',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "8b58f9b09a3e4d28965160d97a5de482",
+ comment: '',
+ owners: '<>',
+ uid: '8b58f9b09a3e4d28965160d97a5de482',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
- arch: "none",
- breed: "none",
+ arch: 'none',
+ breed: 'none',
apt_components: [],
apt_dists: [],
- mirror: "",
+ mirror: '',
rsyncopts: {},
- proxy: "<>",
- createrepo_flags: "<>",
+ proxy: '<>',
+ createrepo_flags: '<>',
environment: {},
keep_updated: false,
mirror_locally: false,
- mirror_type: "baseurl",
+ mirror_type: 'baseurl',
priority: 0,
rpm_list: [],
yumopts: {},
autoinstall_meta: {},
boot_files: {},
- os_version: "",
+ os_version: '',
template_files: {},
- }
- ]
- service.get_repos().subscribe(value => {
- expect(value).toEqual(result)
- done()
+ },
+ ];
+ service.get_repos().subscribe((value) => {
+ expect(value).toEqual(result);
+ done();
});
- const mockRequest = httpTestingController.expectOne('http://localhost/cobbler_api');
+ const mockRequest = httpTestingController.expectOne(
+ 'http://localhost/cobbler_api',
+ );
mockRequest.flush(methodResponse);
});
it('should execute the get_images action on the Cobbler Server', (done: DoneFn) => {
// eslint-disable-next-line max-len
- const methodResponse = `parentdepth0ctime1721480441.493743mtime1721480441.493743uid911577c3691b4294acdf017e7f15f4cfnametestimagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0archx86_64autoinstall<<inherit>>breedfileimage_typedirectnetwork_count0os_versionboot_loadersmenuvirt_auto_boot0virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_type<<inherit>>kickstart<<inherit>>ks_meta`
+ const methodResponse = `parentdepth0ctime1721480441.493743mtime1721480441.493743uid911577c3691b4294acdf017e7f15f4cfnametestimagecommentkernel_optionskernel_options_postautoinstall_metafetchable_filesboot_filestemplate_filesowners<<inherit>>mgmt_classes<<inherit>>mgmt_parametersis_subobject0archx86_64autoinstall<<inherit>>breedfileimage_typedirectnetwork_count0os_versionboot_loadersmenuvirt_auto_boot0virt_bridge<<inherit>>virt_cpus1virt_disk_driverrawvirt_file_size<<inherit>>virt_pathvirt_ram<<inherit>>virt_type<<inherit>>kickstart<<inherit>>ks_meta`;
const result: Array = [
{
ctime: 1721480441.493743,
mtime: 1721480441.493743,
- name: "testimage",
+ name: 'testimage',
depth: 0,
- comment: "",
- owners: "<>",
- uid: "911577c3691b4294acdf017e7f15f4cf",
- arch: "x86_64",
- breed: "",
- file: "",
+ comment: '',
+ owners: '<>',
+ uid: '911577c3691b4294acdf017e7f15f4cf',
+ arch: 'x86_64',
+ breed: '',
+ file: '',
fetchable_files: {},
is_subobject: false,
- parent: "",
+ parent: '',
kernel_options: {},
kernel_options_post: {},
- mgmt_classes: "<>",
+ mgmt_classes: '<>',
mgmt_parameters: {},
- autoinstall: "<>",
- image_type: "direct",
+ autoinstall: '<>',
+ image_type: 'direct',
network_count: 0,
- os_version: "",
+ os_version: '',
virt_auto_boot: false,
- virt_bridge: "<>",
+ virt_bridge: '<>',
virt_cpus: 1,
- virt_disk_driver: "raw",
- virt_file_size: "<>",
- virt_path: "",
- virt_ram: "<>",
- virt_type: "<>",
- menu: "",
+ virt_disk_driver: 'raw',
+ virt_file_size: '<